Help:Transclusion
Transclusion is the process of including all or part of one wiki page in another page. If one page contains a block of information that you want to copy wholesale onto another page (such as a table of items), you should transclude it instead of copying and pasting it. That way, updating the source section automatically updates any pages that transclude it, avoiding needless repetition and making it easier to keep the wiki up-to-date.
Transcluding entire pages
An entire page can be transcluded onto another page using the syntax {{namespace:Pagename}}. If the source page is in the main namespace, use {{:Pagename}}. This is the same syntax as template calls, and it works in the same way; the software simply assumes Template is the namespace for transclusion if the namespace and colon are not included.
Transcluding sections
Transcluding portions of a page is possible using labeled section transclusion (or LST for short) to designate which parts of the page are able to be transcluded. On the source page, the section to transclude should be marked by using the parser tag <section> in this fashion:
<section begin="section-name"/> This is a transcludable section. You can put anything here. When you transclude this section, the text inside these tags is what shows up on the target page. <section end="section-name"/>
The name inside the begin and end parameters is an identifier to use when transcluding this section, in case a single source page has multiple transcludable sections.
When you save the source page, the section will not look any different, but this allows this section to be transcluded onto other pages using the #lst parser function. On the target page, you use this parser function to indicate the source page and the name of the section on that page to transclude.
| Wikitext | Result |
|---|---|
{{#lst:Source page name|section-name}}
|
This is a transcludable section.
You can put anything here. When you transclude this section, the text inside these tags is what shows up on the target page. |
Replace Source page name with the name of the page and section-name with the name of the section you assigned in the begin and end parameters.
For an example of labeled section transclusion in action, see Accolade (Battles 2) for a source page and Hero Challenge for a target page. The target page transcludes a section containing accolades exclusive to Hero Challenge.
Cargo
Cargo is a more advanced method of transclusion that relies on templates to store data into a table and/or query information from that table in a manner similar to SQL.
Navigation
| Blooncyclopedia | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|