跳转到内容

模組:Infobox road junction

被永久保护的模块
维基百科,自由的百科全书

这是Module:Infobox road junction当前版本,由Xiplus-abot留言 | 贡献编辑于2020年6月23日 (二) 00:23 (已保护“Module:Infobox road junction”:高風險模板:930引用<!-- 機器人3 -->([编辑=仅允许自动确认用户](无限期)[移动=仅允许自动确认用户](无限期)))。这个网址是本页该版本的固定链接。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)
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