Template:Onlyinclude/doc

This is a convenience template for inserting a selective transclusion clause, as described at WP:Transclusion. It can be used to include a part of a source document from any other target document by providing a unique keyword.

By substituting this template in the source document (see Usage below), the following will be inserted: &lt;onlyinclude&gt;{{#ifeq:{{{1|keyword}}}|keyword|text to be included}}&lt;/onlyinclude&gt;

When the source document is viewed, the text to be included will be displayed regardless of the  tags.

To display the text to be included in a target document, the source document should be transcluded along with the keyword (see below).

Source document
At the source document, use the following: {{subst:onlyinclude|id=keyword|text to be included}} where Note that this template must be substituted!
 * keyword is a unique keyword used for referring to the text to be included;
 * text to be included is the text that will be included in the target document when the source document is transcluded along with the keyword.

Target document
To transclude the text to be included from the source document into the target document, use the following: {{:PAGENAME|keyword}} where
 * is the name of the source document (in article namespace);
 * keyword is the unique keyword as used in the source document.

Source document
Let's assume the name of the source document is "Some City".

The following is inserted when this document is being edited:

Which will be substituted in the document's source by:

When viewing the source document, it will display:
 * 151,853

Target document
The following is inserted in a target document:

When viewing the target document, it will display:
 * 151,853