Diferencia entre revisiones de «Módulo:Wikibase»
Apariencia
Página creada con «-- Module:Wikibase local p = {} -- Devuelve la ID del ítem, el nombre o el enlace de la página en la wiki local. function p.id(frame) if not mw.wikibase then...» |
m UAwiki movió la página Módulo:Zona de pruebas/Juan Mayordomo/Wikibase a Módulo:Wikibase sin dejar una redirección: preparar la fusión de historiales |
(Sin diferencias)
| |
Revisión del 22:10 9 jun 2015
La documentación para este módulo puede ser creada en Módulo:Wikibase/doc
-- Module:Wikibase
local p = {}
-- Devuelve la ID del ítem, el nombre o el enlace de la página en la wiki local.
function p.id(frame)
if not mw.wikibase then
return "módulo wikibase no encontrado"
end
entity = mw.wikibase.getEntityObject()
if entity == nil then
return ""
end
return entity.id
end
-- Devuelve la etiqueta de un ítem dado.
function p.etiqueta(frame)
if frame.args[1] == nil then
entity = mw.wikibase.getEntityObject()
if not entity then return nil end
id = entity.id
else
id = frame.args[1]
end
return mw.wikibase.label( id )
end
-- Devuelve la página local de un ítem dado.
function p.enlace(frame)
if frame.args[1] == nil then
entity = mw.wikibase.getEntityObject()
if not entity then return nil end
id = entity.id
else
id = frame.args[1]
end
return mw.wikibase.sitelink( id )
end
-- Devuelve la descripción de un ítem dado.
function p.descripcion(frame)
if frame.args[1] == nil then
entity = mw.wikibase.getEntityObject()
if not entity then return nil end
id = entity.id
else
id = frame.args[1]
end
return mw.wikibase.description( id )
end
return p