Difference between revisions of "Module:Infobox"
Jump to navigation
Jump to search
(Simple module to add a page to the right category) |
m (Might needs these spaces) |
||
Line 5: | Line 5: | ||
args = f:getParent().args | args = f:getParent().args | ||
end | end | ||
return "[[Category:Blocks]]" .. f:expandTemplate{ title='Infobox', args = args } | return "[[Category:Blocks]] " .. f:expandTemplate{ title='Infobox', args = args } | ||
end | end | ||
Line 12: | Line 12: | ||
args = f:getParent().args | args = f:getParent().args | ||
end | end | ||
return "[[Category:Items]]" .. f:expandTemplate{ title='Infobox', args = args } | return "[[Category:Items]] " .. f:expandTemplate{ title='Infobox', args = args } | ||
end | end | ||
return p | return p |
Revision as of 17:03, 9 April 2015
Work around for {{Block}}
and {{Item}}
needing to call {{Infobox}}
and add categories (Category:Blocks and Category:Items receptively) to the pages calling them.
The above documentation is transcluded from Module:Infobox/doc. (edit | history)
local p = {} function p.block( f ) if f == mw.getCurrentFrame() then args = f:getParent().args end return "[[Category:Blocks]] " .. f:expandTemplate{ title='Infobox', args = args } end function p.item( f ) if f == mw.getCurrentFrame() then args = f:getParent().args end return "[[Category:Items]] " .. f:expandTemplate{ title='Infobox', args = args } end return p