Help:Templates: Difference between revisions

m
(More content.)
Line 101: Line 101:
*'''Usage''':<code><nowiki>{{#ifeq:<expression>}}</nowiki></code><br>
*'''Usage''':<code><nowiki>{{#ifeq:<expression>}}</nowiki></code><br>
===Inclusion tags===
===Inclusion tags===
====includeonly====
Inclusion tags serve the purpose of dictating what gets included where when transcluding. This is typically used for categories and template documentation. There are 3 tags:
====noinclude====
*'''includeonly''' text will appear only in the transclusion, not in the template.
====onlyinclude====
*'''includeonly''' text will not appear in the transclusion, only in the template.
*'''onlyinclude''' is a bit different: only the text wrapped in the onlyinclude tags will be transcluded, nothing else. Does not affect the source template whatsoever.
 
====Examples====
{| class=wikitable
!Template contents!!Template text!!Contents when transcluded
|-
|This template has <includeonly>stuff</includeonly>.||This template has .||This template has stuff.
|-
|This template has <noinclude>stuff</noinclude>.||This template has stuff.||This template has .
|-
|This template has <onlyinclude>stuff</onlyinclude>.||This template has stuff.||stuff
|}


{{helpnav}}
{{helpnav}}
24,486

edits