Template:Section: Difference between revisions

From Elwiki
m (Text replacement - "| heading=true" to "| header=2")
mNo edit summary
Line 1: Line 1:
<includeonly>__NOTOC__<table class="section" cellspacing="0" cellpadding="0" style="position: relative; width:{{{Widths|100%}}}; padding: 0; margin: 0; font-size: 1em; line-height: 1.5em; border: 1px #000 solid; border-bottom: none; border-spacing: 0;{{{SectionSty|}}}" {{{Attr|}}}>
<includeonly>__NOTOC__<table
   <tr style="width: 100%; text-align: center; vertical-align: middle; height: 2em;{{{hStyles|}}}">{{#forargs:Title
  class="section"
  style="width:{{{Widths|}}}; {{{SectionSty|}}}"
  {{{Attr|}}}
   class="{{{SectionCls|}}}"><tr
  style="{{{hStyles|}}}">{{#forargs:Title
| key
| key
| value
| value
| {{#ifexpr:{{#if:{{#var:value|}}|1|0}} and {{Isnumeric|{{#var:key|}}}}|<th style="width:{{{Width{{#var:key|}}|{{{Width|}}}}}}; {{#ifeq:{{#var:key|}}|0||border-left: 1px #000 solid;}}border-bottom: 1px #000 solid; background-color:{{{Color{{#var:key|}}|{{{Color|}}}}}};{{{hStyle|}}};{{{hStyle{{#var:key|}}|}}}" {{{Attr{{#var:key|}}|}}}><{{#ifeq:{{{heading|}}}|true|h2|span}} id="{{anchorencode:{{#var:value|}}}}" style="border-bottom: none; display: inline; font-size: 1em; font-weight: bold; 1px 1px 1px black;" class="textfloat">{{#var:value|}}</{{#ifeq:{{{heading|}}}|true|h2|span}}></th>}}}}</tr>
| <th
   <tr style="width: 100%; vertical-align: top;{{{Styles|}}}">{{#forargs:Title
  style="width:{{{Width{{#var:key|}}|{{{Width|}}}}}};
        background-color:{{{Color{{#var:key|}}|{{{Color|}}}}}};
        {{{hStyle|}}};
        {{{hStyle{{#var:key|}}|}}}"
  {{{hAttr{{#var:key|}}|{{{hAttr|}}}}}}>{{#if:{{{header|}}}
    |<h{{{header|}}} id="{{anchorencode:{{#var:value|}}}}">{{#var:value|}}</h{{{header|}}}>
    |{{#var:value|}}}}</th>
}}</tr><tr
   style="{{{Styles|}}}">{{#forargs:Title
| key
| key
| value
| value
| {{#ifexpr:{{#if:{{#var:value|}}|1|0}} and {{Isnumeric|{{#var:key|}}}}|<td style="padding: 0.5em;{{{Style|}}};{{{Style{{#var:key|}}|}}}">{{{Content{{#var:key|}}|}}}</td>}}}}</tr>
| <td
</table></includeonly><noinclude>__TOC__<br>{{DISPLAYTITLE:Section}}
  style="width:{{{Width{{#var:key|}}|{{{Width|}}}}}};
{{Section
        {{{Style|}}};
| header=2
        {{{Style{{#var:key|}}|}}}"
| Color0=lightgreen
  {{{Attr{{#var:key|}}|{{{Attr|}}}}}>{{{Content{{#var:key|}}|}}}</td>
| Title0=Section Template
}}</tr></table></includeonly>
| Content0=Section is an UI template developed by '''[[User:boxsnake|boxsnake]]''', in order to enhance the UI design. Also, this is an example of ''Section''.
}}
{{Section
| header=2
| Color0=purple
| Title0=Parameters
| Content0=<span>
# ''Section'' only have one row, but can have as many columns as you want. More columns takes more time.
#* If you want more than one rows, more than one ''Section'' will help.
# If parameter(s) starting with '''Title''' and following by numbers (e.g. '''Title0''') is/are specified, the corresponding column(s) will be added.
#* Note every column except '''Title0''' has left border, in order to be extended from the left column.
# Parameters for '''<u>Table</u>''' (Whole ''Section''):
## '''SectionSty''' - CSS syntax style for ''Section''.
## '''Attr''' - HTML syntax for ''Section''.
## '''Widths''' - CSS syntax width for ''Section''. Default: '''100%'''.
# Parameters for '''<u>Headlines</u>''' (where '''Title''' goes):
## '''TitleStys''' - CSS syntax style for whole headline.
## '''TitleSty''' - CSS syntax style for every header cell.
## '''TitleSty###''' - CSS syntax style for header of '''Title###'''.
## '''Color''' - CSS syntax color for all headers.
## '''Color###''' - CSS syntax color for header of '''Title###'''.
## '''Attr###''' - HTML syntax for header of '''Title###'''.
## '''Title###''' - Content in header of '''Title###'''.
# Parameters for '''<u>Contents</u>''':
## '''Styles''' - CSS syntax style for whole content.
## '''Style''' - CSS syntax style for every cell of content.
## '''Style###''' - CSS syntax style for content corresponding to '''Title###'''.
## '''Content###''' - Content in cell of '''Title###'''.
# Parameters for '''<u>Columns</u>''':
## '''Width''' - CSS syntax width of every column.
## '''Width###''' - CSS syntax width of column of '''Title###'''.
# Generally, styles will override ancestor styles. For example, '''''TitleStys''''' overrides '''''SectionSty''''', and '''''TitleSty''''' overrides both '''''TitleStys''''' and '''''SectionSty''''', and '''''TitleSty###''''' overrides all the three.
# If you want table and (un)ordered lists in contents, use '''<span<nowiki/>>''' tag or '''<nowiki><span style="display:none">{{</span>...<span style="display:none">}}</span></nowiki>''' to escape (wrap) the code.
# To be extended from other ''Section'' templates upwards, this template has no bottom border originally, use ''SectionSty'' to specify it if needed.
# The lines under each header are stated in '''''TitleSty''''' or '''''TitleSty###''''' rather than '''''TitleStys'''''.
# Default padding in headlines and contents is 0.5em.
# Link anchor can link to ''Section'' headers. (e.g. <nowiki>[[7-4#Mobs:|'''Mobs''']]</nowiki> can link to 7-4's Mobs section.)
# Add heading=true if you want the ''Section'' headers to be h2 tags. Otherwise, the headers will be spans.
# You need __<nowiki/>TOC__ to show TOC of the Sections.
</span>
}}
{{Section
| header=2
| SectionSty=border-bottom: 1px #000 solid;
| Color0=green
| Title0=Other Samples
| Content0=
  {{Section
  | SectionSty=border: 2px #ccc solid; border-radius: 5px;
  | Color0=lightblue
  | Title0=Sample 1
  | Content0=Sample 1
  }}<pre>
{{Section
| SectionSty=border: 2px #ccc solid; border-radius: 5px;
| Color0=lightblue
| Title0=Sample 1
| Content0=Sample 1
}}</pre>
}}</noinclude>

Revision as of 04:28, 5 February 2015