Diferencia entre revisiones de «Módulo:Wikibase»
Apariencia
m Protegió «Módulo:Wikibase»: Segunda página más transcluida del proyecto, alto riesgo ([Editar=Solo bibliotecarios] (indefinido) [Pueden trasladar=Solo bibliotecarios] (indefinido)) |
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...» |
||
| Línea 43: | Línea 43: | ||
return mw.wikibase.sitelink( id ) | 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 | end | ||
return p | return p | ||
Revisión del 20:20 8 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