Difference between revisions of "Template:Infobox/Doc"

Jump to navigation Jump to search
no edit summary
Line 11: Line 11:
     ...
     ...
   <tr>
   <tr>
       <td class="ibfobox-data-title">...</td>
       <td class="infobox-data-title">...</td>
       <td class="ibfobox-data">...</td>
       <td class="infobox-data">...</td>
   </tr>
   </tr>
     ...
     ...
Line 37: Line 37:
This example infobox has 5 parameters:
This example infobox has 5 parameters:


<code>title</code> - it used to force custom text in a header of infobox
<code>title</code> - used to force custom text in a header of infobox
* In the code it looks like this: <code><nowiki>{{#if: {{{title|}}}|{{{title|}}}|{{PAGENAME}}}}</nowiki></code>
* In the code it looks like this: <code><nowiki>{{#if: {{{title|}}}|{{{title|}}}|{{PAGENAME}}}}</nowiki></code>
** the use of <code>#if:</code> [[mw:Help:Extension:ParserFunctions|parser function]] means that parameter is optional and won't work if it's not filled
** the use of <code>#if:</code> [[mw:Help:Extension:ParserFunctions|parser function]] means that parameter is optional and won't work if it's not filled
Line 59: Line 59:
<code>prm1</code> - second data parameter, with "Parameter 2" title
<code>prm1</code> - second data parameter, with "Parameter 2" title
* In the code:<br><code><nowiki>{{#if: {{{prm2|}}}|<tr>
* In the code:<br><code><nowiki>{{#if: {{{prm2|}}}|<tr>
           <td class="ib-data-title">Parameter 2</td>
           <td class="infobox-data-title">Parameter 2</td>
           <td class="ib-data">{{{prm2}}}</td>
           <td class="infobox-data">{{{prm2}}}</td>
     </tr>}}</nowiki></code>
     </tr>}}</nowiki></code>
** <code>#if:</code> again means it's optional, but if filled it will add a row with two columns
** <code>#if:</code> again means it's optional, but if filled it will add a row with two columns
Line 69: Line 69:
* and several '''classes'''
* and several '''classes'''
** <code>infobox</code> for entire table - this wiki already has such class in [[MediaWiki:Common.css|Common.css]] page; most notably it puts the box into right side of the page and gives it background color and border
** <code>infobox</code> for entire table - this wiki already has such class in [[MediaWiki:Common.css|Common.css]] page; most notably it puts the box into right side of the page and gives it background color and border
** <code>ibfobox-data-title</code> - for column with data titles; will be a custom class in [[Template:Classic infobox/styles.css]] page - for educational purposes it will brighter than usual Wikipedia style
** <code>infobox-data-title</code> - for column with data titles; will be a custom class in [[Template:Classic infobox/styles.css]] page - for educational purposes it will brighter than usual Wikipedia style
** <code>ibfobox-data</code> - for second column, with data values; same as previous
** <code>infobox-data</code> - for second column, with data values; same as previous


===Categories===
===Categories===

Navigation menu