Help: Template Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.Anti-spam check. Do not fill this in! ===<span id="Noinclude, includeonly, and onlyinclude"></span>Inclusion control: noinclude, includeonly, and onlyinclude=== {{shortcut|WP:NOINCLUDE|WP:INCLUDEONLY|WP:ONLYINCLUDE}} By default, when a page calls a template, MediaWiki includes the expansion of the entire template in the calling page. However, it is possible to modify that behavior, using tags that specify which parts of the template code are to be included. This makes it possible for the template to contain information only for display when the template page itself is displayed, such as the template's [[Wikipedia:Template documentation|documentation]], or [[WP:CAT#T|categories]]. It is also possible to have parts of the template be included in calling pages, but {{em|not}} be displayed when the template page itself is displayed and not be processed when the template page itself is saved (e.g., categories to be applied to calling pages which do not apply to the template). The tags are as follows: * {{xtag|noinclude|p}} β The text between the tags is {{em|not}} included when the template is called, but {{em|is}} processed when the template itself is displayed or saved; a common use is for [[WP:Template documentation|documentation in templates]]. * {{xtag|onlyinclude|p}} β Nothing on the page {{em|except}} what appears between the tags is included when the template is called. * {{xtag|includeonly|p}} β The text between the tags {{em|is}} included when the template is called, but is {{em|not}} processed when the template is displayed or saved. {| class="wikitable" style="text-align: center;" ! Wikitext ! What is rendered {{em|here}} (template page) ! What is included {{em|there}} (calling page) |- |<code><nowiki><noinclude> text1 </noinclude> text2</nowiki></code> |<code>text1 text2</code> |<code>text2</code> |- |<code><nowiki><onlyinclude> text1 </onlyinclude> text2</nowiki></code> |<code>text1 text2</code> |<code>text1</code> |- |<code><nowiki><includeonly> text1 </includeonly> text2</nowiki></code> |<code>text2</code> |<code>text1 text2</code> |- |<code><nowiki><onlyinclude><includeonly> text1 </includeonly></onlyinclude> text2</nowiki></code> |<code>text2</code> |<code>text1</code> |} Perhaps the most common issue with the use of these blocks is unwanted spaces or lines. It is important to remember that the effect of these tags begins immediately before the first angle bracket, not on the previous line or at the previous visible character; similarly the effect ends immediately after the last angle bracket, not on the next line or with the next visible character. For example: :{{mxt|<nowiki>}}<includeonly></nowiki>}} :{{!mxt|<nowiki>}}</nowiki><br /><nowiki></includeonly></nowiki>}} These tags can be nested inside each other, though (for a given page) this is really meaningful only for the {{tag|onlyinclude|o}} tag; nesting {{tag|includeonly|o}} and {{tag|noinclude|o}} tags is fairly pointless. Be careful to properly nest the tags, however. Constructions like {{tag|onlyinclude|o}}abc{{tag|includeonly|o}}def{{tag|onlyinclude|c}}ghi{{tag|includeonly|c}} will {{em|not}} work as expected. Use the "first opened, last closed" rule that is standard for HTML/XML. Summary: Please note that all contributions to Christianpedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here. You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Christianpedia:Copyrights for details). Do not submit copyrighted work without permission! Cancel Editing help (opens in new window) Discuss this page