Tim Starling wrote:
Infoboxes are a very important application of templates. There needs to
be some way conditionally add table rows based on whether or not a given
template parameter is defined.
Surely this could be done by adding a certain sub-syntax to the table
row syntax? Something like
|-#ifdef:parameter
e.g.
{|
|-#ifdef:heading style="background-color: pretty;"
! {{heading}}
|-
| {{content}}
|}
Of course, that would be an extremely specific syntax (specific to
templates *and* to table-rows), but in my opinion, it is way cleaner and
more structured than any hacky attempt to fool the parser into correctly
patchworking the table from pieces.
When people complained about the argument separators
in {{#if:}}
clashing with table syntax, I told them to use HTML table tags
instead.
I am quite surprised that you didn't notice that this means you are
suggesting a workaround, as opposed to a solution.
Why is the template required to close its own tags? It
would make things
a lot easier if this was not required.
I totally can't believe you said that.
Timwi