Transclusion is a special way of
including a wiki page in another wiki page. Instead of just displaying the contents of the included page as is, you can change how the content is displayed depending on how you write the link.
This method requires that you create a page to be used as a template. This page must contain variables represented by %1, %2, %3, and so on.
You can then create a transclusion link or links to that page by creating a normal include link with the values for the variables added after the page name. Each value must be preceded by a pipe (
|value). The values you define in the link will be used from left to right to replace the numbered variables on the page you're including.
Use this code, replacing PAGENAME with the name of the page to be included, and VALUE1 and VALUE2 with the values you'd like the two variables to have when the included page is displayed:
[[Include::PAGENAME|VALUE1|VALUE2|VALUE3]]
These examples use the
WoaS::Template::Example::Transclusion page which contains two variables. The contents of that page are:
<big style="color:lime">%1 had a little %2</big>
Use this code:
[[Include::WoaS::Template::Example::Transclusion|Mary|lamb]]
To create this:
Mary had a little lambOr use this code:
[[Include::WoaS::Template::Example::Transclusion|Fred|snack]]
To create this:
Fred had a little snackOr use this code:
[[Include::WoaS::Template::Example::Transclusion|Bob|Jane|Jack]]
To create this:
Bob had a little JaneWiki and HTML code in transclusion
Some wiki code and HTML tags are accepted in the values.
Use this code:
[[Include::WoaS::Template::Example::Transclusion|*Mary*|*lamb*.<br><br>Its /fleece/ was white as _snow_.]]
To create this:
Mary had a little lamb.
Its fleece was white as snow.Infinite recursion happens when you create an include link to the current page or to another page that that has an include link to the current page. The included page will be repeated multiple times followed by the include link itself being displayed in bold red text surrounded by infinity symbols like this:
∞ [[Include::PAGENAME]] ∞
You should always prevent infinite recursions from happening.