Difference between revisions of "Template:UI Object Template"

From HSYCO
Jump to navigation Jump to search
(Created page with "== Template == The template is html code that is applied to every item. $<n> (with n starting from 1) is used to indicate how to include each part of the item's label inside t...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Template ==
 
== Template ==
The template is html code that is applied to every item. $<n> (with n starting from 1) is used to indicate how to include each part of the item's label inside the html.
+
The template is HTML code that is applied to every item. An item's label is split into parts using the pipe character. These parts are replaced inside the template's code to form the final item's source.
A label can specify more than one part using the pipe character: |
+
 
 +
'''%<n>''' (with n starting from 1) is used to include each part of the item's label inside the HTML. To avoid the % symbol to be replaced, use '''&amp;#37;''' instead.
  
 
E.g. If the template is:
 
E.g. If the template is:
 
<syntaxhighlight lang="html4strict">
 
<syntaxhighlight lang="html4strict">
<table><tr><td>$1</td><td>$2</td></table>
+
<table><tr><td>%1</td><td>%2</td></table>
 
</syntaxhighlight>
 
</syntaxhighlight>
 
and the labels are:
 
and the labels are:

Latest revision as of 18:21, 11 March 2015

Template

The template is HTML code that is applied to every item. An item's label is split into parts using the pipe character. These parts are replaced inside the template's code to form the final item's source.

%<n> (with n starting from 1) is used to include each part of the item's label inside the HTML. To avoid the % symbol to be replaced, use &#37; instead.

E.g. If the template is:

<table><tr><td>%1</td><td>%2</td></table>

and the labels are:

a|one,b|two

the resulting items will have the following html code:

<table><tr><td>a</td><td>one</td></table>

and

<table><tr><td>b</td><td>two</td></table>