Template:Infobox/doc: Difference between revisions

m
empty --> empty
m (1 revision imported: Wikipedia Infobox)
imported>Dmoore5556
m (empty --> empty)
 
Line 1: Line 1:
{{distinguish|Template:Userbox}}
{{distinguish|Template:Userbox}}
{{Documentation subpage}}
{{Documentation subpage}}
<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1|2}}|old | |{{High-use|3,160,000+|info=[https://en.wikipedia.org/w/index.php?search=hastemplate%3Ainfobox&title=Special:Search&profile=default&fulltext=1&searchToken=69ttd5z1iekjo54r1z2qvq3uo 3,035,000] of the {{NUMBEROFARTICLES}} pages in mainspace that qualify as articles transclude infoboxes ({{#expr:(3035000/{{NUMBEROFARTICLES:R}}) round 0}}%).|all-pages = yes}}{{Lua|Module:Infobox}}}}</includeonly>
<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1|2}}|old | |{{High-use|3,160,000+|info=[https://en.wikipedia.org/w/index.php?search=hastemplate%3Ainfobox&title=Special:Search&profile=default&fulltext=1&searchToken=69ttd5z1iekjo54r1z2qvq3uo 3,035,000] of the {{NUMBEROFARTICLES}} pages in mainspace that qualify as articles transclude infoboxes ({{#expr:(3035000*100/{{NUMBEROFARTICLES:R}}) round 0}}%).|all-pages = yes}}{{Lua|Module:Infobox}}}}</includeonly>
{{Parameter names example
{{Parameter names example
  |name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
  |name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
Line 169: Line 169:
</pre>{{clear}}
</pre>{{clear}}


header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no emty row appears before the next static content. The trick to this is that the "#if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item1, item2 and item3 are undefined will the if statement fail.
header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no empty row appears before the next static content. The trick to this is that the "#if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item1, item2 and item3 are undefined will the if statement fail.


Note that such trick may be sometimes very complex to test if there are many data items whose value depends on complex tests (or when a data row is generated by a recursive invokation of this template as a [[#Subboxes|subbox]]). Ideally, the Lua module supporting this template should now support a new way to make each header row autohideable by detecting if there is at least one non-empty data row after that header row (a parameter like "autohide header1 = yes", for example, would remove the need to perform the "#if" test so that we can just to define "header1 = Optional header"),
Note that such trick may be sometimes very complex to test if there are many data items whose value depends on complex tests (or when a data row is generated by a recursive invokation of this template as a [[#Subboxes|subbox]]). Ideally, the Lua module supporting this template should now support a new way to make each header row autohideable by detecting if there is at least one non-empty data row after that header row (a parameter like "autohide header1 = yes", for example, would remove the need to perform the "#if" test so that we can just to define "header1 = Optional header"),
Anonymous user