Difference between revisions of "Help:Templates"

From WikiCorporates
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
−
== Simple Template with one Parameter ==
+
=== Simple Template with one Parameter ===
 
<pre>Template Code: <span>''See main article: [[{{{1}}}]]''</span></pre>
 
<pre>Template Code: <span>''See main article: [[{{{1}}}]]''</span></pre>
 
<pre>To Call: {{SeeMain|Article Name}}</pre>
 
<pre>To Call: {{SeeMain|Article Name}}</pre>
Line 6: Line 6:
 
[https://www.mediawiki.org/wiki/Help_talk:Templates#%5BRESOLVED%5D_Missing_parameter MediaWiki: Missing Parameter]
 
[https://www.mediawiki.org/wiki/Help_talk:Templates#%5BRESOLVED%5D_Missing_parameter MediaWiki: Missing Parameter]
  
−
== Simple Template with two Parameters; 2nd one is optional ==
+
=== Simple Template with two Parameters; 2nd one is optional ===
 
<pre>Template Code: <span>''{{#if:{{{2|}}} | See main articles: [[{{{1}}}]], [[{{{2}}}]] | See main article: [[{{{1}}}]] }}''</span></pre>
 
<pre>Template Code: <span>''{{#if:{{{2|}}} | See main articles: [[{{{1}}}]], [[{{{2}}}]] | See main article: [[{{{1}}}]] }}''</span></pre>
 
<pre>To Call: {{SeeMain|Article Name 1|Article Name 2}}</pre>
 
<pre>To Call: {{SeeMain|Article Name 1|Article Name 2}}</pre>
  
−
== Notes ==
+
=== Notes ===
−
* To specify the Template Category, underneath the code write: <pre><noinclude>[[Category:Templates|{{PAGENAME}}]]</noinclude></pre>
+
* To specify the Template Category, on the '''same line''' as the last line of code, write: <pre><noinclude>[[Category:WikiCorporates templates]]</noinclude></pre>
  
 
* Template:Main on W'pedia is written as a Module: [https://en.wikipedia.org/w/index.php?title=Module:Main&action=edit Wikipedia:Module Main]
 
* Template:Main on W'pedia is written as a Module: [https://en.wikipedia.org/w/index.php?title=Module:Main&action=edit Wikipedia:Module Main]
Line 22: Line 22:
 
** [https://www.mediawiki.org/wiki/Help:Parser_functions_in_templates MediaWiki:Parser Functions in Templates]
 
** [https://www.mediawiki.org/wiki/Help:Parser_functions_in_templates MediaWiki:Parser Functions in Templates]
 
** http://community.wikia.com/wiki/Help:Template_parameters
 
** http://community.wikia.com/wiki/Help:Template_parameters
−
** [https://stackoverflow.com/questions/237229555/mediawiki-forcing-new-line-in-templates StackOverflow:
+
** [https://stackoverflow.com/questions/23722955/mediawiki-forcing-new-line-in-templates StackOverflow:MediaWiki:Forcing new line in templates]
  
−
[[Category:Help]]
+
[[Category:WikiCorporates templates]]

Latest revision as of 14:47, 30 May 2020

Simple Template with one Parameter

Template Code: <span>''See main article: [[{{{1}}}]]''</span>
To Call: {{SeeMain|Article Name}}

Solution found here: MediaWiki: Optional Fields, MediaWiki: Missing Parameter

Simple Template with two Parameters; 2nd one is optional

Template Code: <span>''{{#if:{{{2|}}} | See main articles: [[{{{1}}}]], [[{{{2}}}]] | See main article: [[{{{1}}}]] }}''</span>
To Call: {{SeeMain|Article Name 1|Article Name 2}}

Notes

  • To specify the Template Category, on the same line as the last line of code, write:
    <noinclude>[[Category:WikiCorporates templates]]</noinclude>