Modul:generateMapFrame

A Wikiszótárból, a nyitott szótárból

A modult a Modul:generateMapFrame/doc lapon tudod dokumentálni

local p = {}

function p.makeMap()
    local title = mw.title.getCurrentTitle().text
    local entityId = mw.wikibase.getEntityIdForTitle( title, 'enwiki' ) 
    if entityId then
    	local  mapstring = "<mapframe zoom=\"10\" width=\"400\" height=\"400\">    	{  \"type\": \"ExternalData\",  \"service\": \"geopoint\",  \"ids\": \"" .. entityId .. "\"}</mapframe>"
        return mapstring
    else
    	local  emptystring = "<mapframe zoom=\"10\" width=\"400\" height=\"400\">    	{  \"type\": \"ExternalData\",  \"service\": \"geopoint\",  \"ids\": \"\"}</mapframe>"
        return emptystring
    end
end

return p