Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Usage  



1.1  Source document  





1.2  Target document  







2 Example  



2.1  Source document  





2.2  Target document  







3 See also  














Template:Onlyinclude






فارسی

سنڌي
 

Edit links
 









Template
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Usage: {{subst:onlyinclude|id=keyword|text to be included}}

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:

<onlyinclude>{{#ifeq:{{{1|keyword}}}|keyword|text to be included}}</onlyinclude>

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

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

Usage[edit]

Source document[edit]

At the source document, use the following:

{{subst:onlyinclude|id=keyword|text to be included}}

where

Note that this template must be substituted! (subst:)

Target document[edit]

To transclude the text to be included from the source document into the target document, use the following:

{{:PAGENAME|keyword}}

where

Example[edit]

Source document[edit]

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

The following is inserted when this document is being edited:

{{subst:onlyinclude|id=population|151,853}}

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

<onlyinclude>{{#ifeq:{{{1|population}}}|population|151,853}}</onlyinclude>

When viewing the source document, it will display:

151,853

Target document[edit]

The following is inserted in a target document:

{{:Some City|population}}

When viewing the target document, it will display:

151,853

See also[edit]


Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Onlyinclude&oldid=504783566"

Hidden category: 
Wikipedia substituted templates
 



This page was last edited on 29 July 2012, at 16:20 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki