Template talk:Navbox Val Templates

From Unofficial Homecoming Wiki
Jump to navigation Jump to search

Making Sense of these templates

stuff

<!-- HTML comment -->
{{{parameter}}}
{{template}}
| (pipe) separates stuff inside of curly braces

Original Code

Def'''(''' {{#ifeq:{{{1|0|}}} | 0 ||{{color|#3b89a0;font-weight: bold|M{{#if: {{{m|}}} |{{color|red;font-weight: normal|-'''{{{1|0}}}'''}}|{{{1|0}}}}}}}}} {{#ifeq:{{{2|0|}}} | 0 ||{{color|#3e3ea0;font-weight: bold|R{{#if: {{{r|}}} |{{color|red;font-weight: normal|-'''{{{2|0}}}'''}}|{{{2|0}}}}}}}}} {{#ifeq:{{{3|0|}}} | 0 ||{{color|#c62167;font-weight: bold|A{{#if: {{{a|}}} |{{color|red;font-weight: normal|-'''{{{3|0}}}'''}}|{{{3|0}}}}}}}}}''')'''

Formatted Code

Def'''(''' 
 {{#ifeq:{{{1|0|}}} | 0
  |
  |{{color
    |#3b89a0;font-weight: bold
    |M{{#if: {{{m|}}} 
       |{{color
         |red;font-weight: normal
         |-'''{{{1|0}}}'''
        }}
       |{{{1|0}}}
      }}
   }}
 }}
 {{#ifeq:{{{2|0}}} | 0
  |
  |{{color
    |#3e3ea0;font-weight: bold
    |R{{#if: {{{r|}}} 
       |{{color
         |red;font-weight: normal
         |-'''{{{2}}}'''
        }}
       |{{{2}}}
      }}
   }}
 }}
 {{#ifeq:{{{3|0|}}} | 0
  |
  |{{color
    |#c62167;font-weight: bold
    |A{{#if: {{{a|}}}
       |{{color
         |red;font-weight: normal
         |-'''{{{3|0}}}'''
        }}
       |{{{3|0}}}
      }}
   }}
 }}
''')'''

Commented Code

Def'''(''' 
 <!-- test for number other than 0 in first parameter -->
 {{#ifeq:{{{1|0}}} | 0
  |<!-- True: first parameter is 0, do not display anything -->
  |{{color <!--False: first parameter is not 0, change the color of text to follow-->
    |#3b89a0;font-weight: bold
    |M{{#if: {{{m|}}} <!-- after setting color and displaying the letter, test for modifying parameter -->
       |{{color<!-- True, modifying parameter has something in it, change the color again -->
         |red;font-weight: normal
         |-'''{{{1}}}'''<!-- display first parameter value with dash (minus sign) -->
        }}<!-- end second color modifier -->
       |{{{1|0}}}<!-- modifying parameter missing, color left alone and first parameter value displayed -->
      }}<!-- end modifying parameter if statement -->
   }}<!-- end first color -->
 }}<!-- end ifeq statement -->
''')'''