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 = {}
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 ( entity ) then
local cached = loadCacheSafe( entity.id );
if ( cached ) then
return cached;
end
end
return entity .. [[Kategorija:Objekta ni vpisanega v Wikipodatkih]];
end
return p