Module:Finditem
Jump to navigation
Jump to search
![]() | This Lua module is used on approximately 855,000 pages, or roughly 43% of all pages. To avoid major disruption and server load, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. 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