Open main menu

Changes

Template:Infobox/doc

1 byte added, 19:02, 6 January 2019
m
empty --> empty
</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 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"),
Anonymous user