Help:Includeonly and Noinclude

From TrainSpottingWorld, for Rail fans everywhere


<Frequently Asked Questions
This page is part of the Frequently Asked Questions help scheme.


How do I make things appear or not appear when my page is transcluded?

There is a neat set of syntax that controls whether thinsg are included in a transclusion:

<includeonly>

This does what it says. "Stuff", any stuff, between a pair of <includeonly></includeonly> tags is included when the page is transcluded, but never shows up in the original page.

<noinclude>

This is similar. But stuff surrounded by <noinclude></noinclude> tags shows up in the current page, but doesn't show up when the page is transcluded.

Deployment

Deploy the tag that does what you want when the page you are working in is going to be transcluded. That type of a page is usually a template, but FAQ pages like this one are transcluded. Any page can be transcluded.

Be very careful when nesting the tags. Debugging your unusual results is not easy!