模組:Infobox road junction
外观
![文档图示](http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png)
您可能想要创建本Scribunto模块的文档。 编者可以在本模块的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。本模块的子页面。 |
local p = {}
function p.map(frame)
local pframe = frame:getParent()
local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template
local map = args.map or ''
if map == '' then
local entity = mw.wikibase.getEntity() or {}
local claims = entity.claims or {}
local mapProp = claims.p15
if not mapProp then
return ""
end
map = mapProp[0].mainsnak.datavalue.value
end
local alt = args.map_alt or ''
return "[[File:" .. map .. "|250px|alt=" .. alt .. "]]"
end
return p