Difference between revisions of "Template:ContentCell"

From MMNet Wiki
Jump to navigation Jump to search
(Created page with "This template creates table cells, such as on the Main page. Centralizing them into a template allows for global editing of the style in the template without having to edit mu...")
 
Line 1: Line 1:
This template creates table cells, such as on the Main page. Centralizing them into a template allows for global editing of the style in the template without having to edit multiple locations on a page. <br/>
+
<includeonly>|style="{{#if: {{{1|}}}|width:{{{1}}};|}}background: #F9F9F9; border: 1px solid #AAAAAA; vertical-align: top; -moz-border-radius: 5px; -webkit-border-radius: 5px; padding: 7px;" class="notice metadata plainlinks"|{{#if: {{{2|}}}|
When using the longer parameters, such as a large amount of content, they can be spread across several lines as in example 2.
+
{{TitleBar|{{#if: {{{link|}}}|[{{{link}}} {{{2}}}]|{{{2}}} }}}}}}<div style="padding-left: 1em;">
 
+
{{#ifeq: {{{3|}}}||{{:Main Page/{{#replace: {{#replace: {{{2}}}|]|}}|[|}} }}|{{{3}}}}}
'' '''NOTE:''' This template must be enclosed within braces to create a table as shown.''
+
</div>{{#if: {{{4|}}}|
 
+
{{TitleBar|{{#if: {{{link2|}}}|[{{{link2}}} {{{4}}}]|{{{4}}} }} }}<div style="padding-left: 1em;">
;Example 1:
+
{{#ifeq: {{{5|}}}||{{:Main Page/{{#replace: {{#replace: {{{4}}}|]|}}|[|}} }}|{{{5}}}}}
:<code><nowiki>{| style="width:100%;"</nowiki><br/>
+
</div>}}{{#if: {{{6|}}}|
:<nowiki>{{ContentCell|70%|title 1|Content 1|title 2|Content 2}}</nowiki><br/>
+
{{TitleBar|{{#if: {{{link3|}}}|[{{{link3}}} {{{6}}}]|{{{6}}} }} }}<div style="padding-left: 1em;">
:<nowiki>{{ContentCell||title 1|Content 1|title 2|Content 2|title 3|Content 3}}</nowiki><br/>
+
{{#ifeq: {{{7|}}}||{{:Main Page/{{#replace: {{#replace: {{{6}}}|]|}}|[|}} }}|{{{7}}}}}
:<nowiki>|}</nowiki></code>
+
</div>}}</includeonly><noinclude>[[Category:Wikistyle templates]]{{documentation}}</noinclude>
 
 
;Example 2:
 
:<code><nowiki>{| style="width:100%;"</nowiki><br/>
 
:<nowiki>{{ContentCell|70%|title 1|</nowiki><br/>
 
:<nowiki>Content 1</nowiki>
 
:<nowiki>|title 2|</nowiki>
 
:<nowiki>Content 2</nowiki>
 
:<nowiki>}}</nowiki><br/>
 
:<nowiki>{{ContentCell||title 1|Content 1|title 2|Content 2|title 3|Content 3}}</nowiki><br/>
 
:<nowiki>|}</nowiki></code>
 
 
 
;Both Result In:
 
<code>
 
{| style="width:100%;"
 
{{ContentCell|70%|title 1|Content 1|title 2|Content 2}}
 
{{ContentCell||title 1|Content 1|title 2|Content 2|title 3|Content 3}}
 
|}
 
</code>
 
 
 
 
 
<br/>
 

Revision as of 13:09, 2 February 2017

{{Documentation/Template:Fallback

|1= 
|2= 

}}