用户:FRDian/Pagebanner

local p = {} function p.main(frame) args = frame:getParent().args entity = mw.wikibase.getEntityObject()

text = '

'

title = mw.title.getCurrentTitle() if title.namespace == 2 then

text = text .. '
这是一个维基导游' .. "用户页
"

else if not (args.novariant or args["不转换"]) then text = text .. require("Module:NoteTA").main{ G1 = "地名", G2 = "地区用词" } end end

text = text..'
'

text = text..(args.pgname or args["页名"] or args["页名"] or title.subpageText)

text = text..'
'

disambig = args.disambig or args["消歧义"] or args["消歧义"] size = args.size or 25 if disambig then if disambig == 'yes' then disambig = title.text end text = text..'其他同名地点的条目,请见“"..disambig.." (消歧义)”" end if args.UNESCO or args.unesco or args["世界遗产"] or args["世界遗产"] then text = text..'联合国教科文组织世界遗产' end if args.star or args["明星"] then text = text..'明星条目' end if args.otbp or args["曲径通幽"] or args["曲径通幽"] then text = text..'昔日曲径通幽' end if args.dotm or args["目的地"] then text = text..'昔日每月目的地' end if args.ftt or args["特色话题"] or args["特色话题"] then text = text..'昔日特色旅行话题' end

text = text..'

'

image = args[1] if (not image) or defaultimage[image] then if entity and entity.claims and entity.claims["P948"] and entity.claims["P948"][1].mainsnak.datavalue.value then image = entity.claims["P948"][1].mainsnak.datavalue.value else image = defaultimage[image or "none"] end end if title.namespace == 0 then if image == "Disambiguation banner.png" then text = text.. elseif args.index then elseif entity and entity.claims and entity.claims["P948"] and entity.claims["P948"][1].mainsnak.datavalue.value then text = text.. elseif defaultimage[image] then text = text.. else text = text.. end end

text = text..''..(args.caption or args["说明"] or args["说明"]) end text = text..'
'

if not (args.notoc or args["无目录"] or args["无目录"]) then

text = text..''

end

text = text..'

'

if disambig then text = text..'\n:其他同名地点的条目,请见'..disambig..' (消歧义)。' end return text end

return p