Diferencia entre revisiones de «Módulo:Wikibase»
wikitves>UAwiki m (Protegió «Módulo:Wikibase»: recuperar protección ([Editar=Solo bibliotecarios] (indefinido) [Pueden trasladar=Solo bibliotecarios] (indefinido))) |
m (1 revisión importada) |
(Sin diferencias)
|
Revisión actual - 08:31 14 mar 2021
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