Template:Infobox/row: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Chris Day
No edit summary
imported>Caesar Schinas
(Fixed... (Chris; you broke the header display so it showed TDs instead of TRs. I have reverted to my original but re-added the comments which you just added.))
Line 1: Line 1:
{{#ifeq:{{{data|}}}|---
{{#ifeq:{{{data|}}}|---| <!-- If the data field contains three hyphens, "---", then show a full-width header... -->
    |<!-- A centred bold header using the label field content by adding three hypens, "---", in the data field -->! colspan="2" style="text-align:center; font-weight:bold; {{{labelstyle|}}}" {{!}} {{{label}}}
! colspan="2" style="text-align:center; font-weight:bold; {{{labelstyle|}}}" {{!}} {{{label}}}
    |{{#if:{{{data|}}}
|<!-- ...else... -->
          |{{#if:{{{label|}}}
{{#if:{{{data|}}}|
                |<!-- If data AND label field have content-->{{!}}{{#if:{{{labelstyle|}}} | style="{{{labelstyle}}}" {{!}} }} {{{label}}}
{{#if:{{{label|}}}| <!-- ...if the data field AND the label field are both set, show both... -->
                  {{!}}{{#if:{{{datastyle|}}} | style="{{{datastyle}}}" {{!}} }} {{{data}}}
! {{#if:{{{labelstyle|}}} | style="{{{labelstyle}}}" {{!}} }} {{{label}}}
                |<!--ONLY the data field has content, the data will be spread across both columns-->{{!}}colspan="2" {{#if:{{{datastyle|}}} | style="{{{datastyle}}}"}} {{!}} {{{data}}} }}
{{!}} {{#if:{{{datastyle|}}} | style="{{{datastyle}}}" {{!}} }} {{{data}}}
          |}} }}
|<!-- ...else, if just the data field is set, show it full-width... -->
{{!}} colspan="2" {{#if:{{{datastyle|}}} | style="{{{datastyle}}}" {{!}} }} {{{data}}}
}}
}}
}}

Revision as of 18:02, 24 April 2009