Revision 24028292 of "Modul:Testmodul/Lavallen/start" on svwikip = {}
function p.huvudkategori(frame)
local text = ''
local table entity = mw.wikibase.getEntity()
if entity then
if entity.claims.p910 then
local i = 0
while entity.claims.p910[i] do
if entity.claims.p910[i].mainsnak.snaktype == 'value' then
local id = entity.claims.p910[i].mainsnak.datavalue.value['entity-type']
local sort = entity.claims.p910[i].mainsnak.datavalue.value['entity-type']
if sort == 'item' then
id = 'q' .. id
elseif sort == 'property' then
id = 'p' .. id
else
return ''
end
local u = mw.wikibase.sitelink( id )
if string.sub(u, 1, 9) == 'Kategori:' then
text = text .. '[[:' .. u .. ']]'
end
end
i = i + 1
end
end
end
return text
end
return pAll content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://sv.wikipedia.org/w/index.php?oldid=24028292.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|