Hi, I have the following code inside an infobox template: |- {{ #if: {{{district|}}} | ! District: | {{{district|}}} }} |- {{ #if: {{{owned|}}} | ! Owned By: | {{{owned|}}} }} When I use the template inside an article the District and Owned By headings do not display when they have no information (as expected), however when information is supplied the headers show but the information does not...Any ideas where I'm going wrong? Ultimately if information is provided e.g. owned= me then the info box should display 'Owned By: me' but instead it just shows 'Owned By: '
Thanks Tom
Tom M:
{{ #if: {{{district|}}} | ! District: | {{{district|}}} }}
That says:
if {{{district}}} is not empty then output "! District:" else output "{{{district}}}"
The problem is that the vertical bar which you're using as a table field separator is seen by the #if as a parameter separator.
Try this:
{{ #if: {{{district|}}} | ! District: {{!}}{{!}} {{{district|}}} }}
You need to first define Template:!, which consists of the vertical bar character. See for example "Template:Infobox actor" on WP:
http://en.wikipedia.org/w/index.php?title=Template:Infobox_actor&action= edit
Ian
mediawiki-l@lists.wikimedia.org