The above example shows the use of the Transclude template, inserted at the top of the page when the entire page needs to be transcluded. The username and date are auto saved by the template, and the page is tagged as stage:transclude and automatically added to the To Do: Transclude list.
When to Mark a Page for Transclusion
Transclusion is especially useful for managing duplicate content. Whenever a page or section applies to more than one page it should NOT be duplicated. Rather the same content can be transcluded from one page on the other page. Normally the Docs Group will translcude pages, however, users can use the Transclude template to mark it for transclusion.
Note: Although it is possible to transclude only a section of a page, MindTouch does not track changes to section Headings, so your transclusion will fail if you edit the section name. It is much safer to create a separate page for content that is transcluded, and transclude the whole page. See: Wiki Help > Contribute to Wiki > Transclude a Page for further details.
How to Mark a Page for Transclusion
You may mark a page or section for transclusion, by using the Transclude template:
- Position your cursor where the content needs to be transcluded:
- page - insert at the top of the page if the entire page needs transcluding.
- section - insert at the top of the section beneath the section heading if only the section needs transcluding.
- text - insert where you wish the template to display in the text where it needs transcluding.
- In the Editor, select the Template button.
- From the drop down Templates box, select the Transclude template.
- For a page or section - delete either the page or section text in the template box.
- For text - copy and paste the text that needs to be transcluded into the template box.
- Add a note to the template box about what needs to be transcluded and why.
- If you make a mistake - Cancel/undo - CTRL+Z to cancel, or the Undo (back arrow) on Edit Menu, and insert the template again correctly.
- If further discussion or elaboration is required, you may add it to the related Talk page - Wiki Menu > More > Talk Page.
Note: Tags will automatically be inserted. DON'T DELETE these tags as they are used to auto generate our To Do Lists.
The page will be automatically tagged as stage:transclude by the template, and automatically added to the To Do: Transclude list.
Editor's Note: Once a page has been transcluded, and you remove the mark content template, the tag should be changed from stage:transclude to stage:transcluded so it will appear on our list of Transcluded pages. Make sure to add a comment to indicate that the page has been transcluded so anyone editing the page knows to ensure the content still works on all the pages where it displays. See: Wiki Help > Contribute to Wiki > Transclude a Page.
This is an example of the template inserted into a section of text.