Module:Infobox road
Appearance
![]() | This Lua module is used on approximately 26,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
This module implements {{infobox road}}. Please see the template documentation for further explanation.
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 return map end
local entity = mw.wikibase.getEntity() or {}
local claims = entity.claims or {}
local mapProp = claims.p15
if not mapProp then -- no claim of that property
return ""
end
local propValue = mapProp[0].mainsnak.datavalue.value -- This should eventually iterate over all possible values?
return propValue
end
return p