Modul:WikidataGetCurrentId
Videz
Mogoče bi radi ustvarili dokumentacijsko stran za ta Scribunto modul Urejevalci lahko preizkušate ta modul v peskovniku (ustvari | mirror) in testnihprimerih (ustvari). Prosimo, da dodate kategorije v /dok podstran. Podstrani te predloge. |
require "Modul:No globals"
local p = {}
-- .. [[Kategorija:Objekta ni vpisanega v Wikipodatkih]]
local function loadCacheSafe( entityId )
local status, result = pcall( function() return mw.loadData( 'Modul:WikidataCache/' .. entityId ) end );
if ( status == true ) then
return result;
end
return nil;
end
function p.getCurrentId()
local entity = mw.wikibase.getEntityObject();
if not entity then
return '[[Kategorija:Objekta ni vpisanega v Wikipodatkih]]'; -- throwError( 'entity-not-found' )
end
-- local cached = loadCacheSafe( entity.id );
-- if ( cached ) then
-- return cached;
-- end
return entity.id;
end
return p