Module:Finditem
Appearance
This Lua module is used on many pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
Usage
[edit]{{#invoke:Finditem|find}}
local p = {}
local i18n =
{
["noentity"] = "[[Category:Articles without Wikidata item]]",
}
function p.find(frame)
if mw.title.getCurrentTitle().namespace ~= 0
then
return ''
end
local entity = mw.wikibase.getEntityObject()
if frame.args[1] == nil
then er = i18n.noentity
else er = frame.args[1]
end
P31track = (entity and entity.claims and entity.claims["P31"]) and '' or '[[Category:Instance of not in Wikidata]]'
if entity
then
return P31track
else
-- This is the place to insert a category for articles that don't have items in Wikidata.
-- enwiki doesn't seem to have such a category, so in this case it is empty.
-- For other wikis, just remove the two comment dashes and insert the correct category name.
return er
end
end
return p