Module:Is infobox in lead/doc: Difference between revisions
More actions
Created page with "<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> {{high use|risk}} '''Module:Is infobox in lead''' checks if a given infobox is in the lead, is also the only infobox in the lead, and that there aren't two of that same infobox in the article. If that is the case, it returns <code>true</code>, and if not returns nothing. This is designed for use by infoboxes that automatically generate sho..." |
No edit summary |
||
Line 1: | Line 1: | ||
{{doc sub}} | |||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
'''Module:Is infobox in lead''' checks if a given infobox is in the lead, is also the only infobox in the lead, and that there aren't two of that same infobox in the article. If that is the case, it returns <code>true</code>, and if not returns nothing. | '''Module:Is infobox in lead''' checks if a given infobox is in the lead, is also the only infobox in the lead, and that there aren't two of that same infobox in the article. If that is the case, it returns <code>true</code>, and if not returns nothing. | ||
Line 16: | Line 16: | ||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | ||
<!-- Categories below this line, please; interwikis at Wikidata --> | <!-- Categories below this line, please; interwikis at Wikidata --> | ||
[[Category:Modules]] | |||
[[Category:Infobox modules]] | [[Category:Infobox modules]] | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
[[Category:Module documentation pages]] | [[Category:Module documentation pages]] | ||
</noinclude> | </noinclude> |
Latest revision as of 00:47, 2 March 2025
This is a documentation subpage for Module:Is infobox in lead. It may contain usage information, categories and other content that is not part of the original module page. |
Module:Is infobox in lead checks if a given infobox is in the lead, is also the only infobox in the lead, and that there aren't two of that same infobox in the article. If that is the case, it returns true
, and if not returns nothing.
This is designed for use by infoboxes that automatically generate short descriptions, to make sure they only generate a short description if they are the lead infobox.
Usage
{{#invoke:Is infobox in lead|main|[Ii]nfobox [Ff]oo [Bb]ar}}
It does not detect redirects which do not match the parameter. Redirects can be handled with an extra invocation per redirect pattern, e.g.:
{{#invoke:Is infobox in lead|main|[Ii]nfobox [Ss]ong}}{{#invoke:Is infobox in lead|main|[Ii]nfobox [Ss]ingle}}
Redirects can be found with WhatLinksHere.