Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Help:Transclusion"

From Roll20 Wiki

Jump to: navigation, search
m
(add clear example of use, expand descriptions)
Line 4: Line 4:
 
'''[https://www.mediawiki.org/wiki/Help:Transclusion MediaWiki: Transclusion]''' - include parts of one page into another page, which avoids needing to update several pages if they have a shared section transcluded from a separate page.
 
'''[https://www.mediawiki.org/wiki/Help:Transclusion MediaWiki: Transclusion]''' - include parts of one page into another page, which avoids needing to update several pages if they have a shared section transcluded from a separate page.
  
If a large page has sections transcluded to a sub-page, it also makes it easier to link & redirect to the section if it exists on on a separate page, as the  
+
If a large page has sections transcluded to a sub-page, it also makes it easier to link & redirect to the section if it exists on a separate page. Transclusion can be used to show a condensed part of one page/topic on a bigger page, giving the important parts in the bigger page, but
  
 +
'''Transclude existing page'''
 +
To add the content of an another page to the page you're editing, you transclude it by adding <code><nowiki>{{:Name of Page}}</nowiki></code> to the spot where you want it.
 +
 +
For example, to transclude the content of [[Help:Transclusion]] to the middle of your current page that has content before and after:
 +
<pre>==Lorem ipsum==
 +
Taciti leo ac urna facilisi tempus feugiat mattis quisque. Nullam auctor arcu, aliquam amet nisl tortor.
 +
 +
==Transclusion==
 +
{{:Help:Transclusion}}
 +
 +
==Other Stuff==
 +
Odor amet, consectetuer adipiscing elit. Hac turpis fames netus augue tincidunt nunc, turpis est.
 +
</pre>
 +
 +
 +
'''Adjusting what parts of a page gets transcluded'''
 +
If non of the below elements are added to a page, everything will be included if it gets transcluded, including categories, all templates used, and miscellaneous stuff like links to related pages if it has something like it.   
 
* <code><nowiki><noinclude></nowiki></code> - Content within the <code><nowiki>&lt;noinclude> ‎&lt;/noinclude></nowiki></code> tags is excluded from transclusion on the target page. This content still appears on the source page.
 
* <code><nowiki><noinclude></nowiki></code> - Content within the <code><nowiki>&lt;noinclude> ‎&lt;/noinclude></nowiki></code> tags is excluded from transclusion on the target page. This content still appears on the source page.
 
* <code><nowiki><includeonly></nowiki></code> - Content within the <code><nowiki>&lt;includeonly> &lt;/includeonly></nowiki></code>‎ tags is transcluded on the target page, but does not appear on the source page.
 
* <code><nowiki><includeonly></nowiki></code> - Content within the <code><nowiki>&lt;includeonly> &lt;/includeonly></nowiki></code>‎ tags is transcluded on the target page, but does not appear on the source page.
 
* <code><nowiki><onlyinclude></nowiki></code> - Content within the <code><nowiki>‎&lt;onlyinclude> &lt;/onlyinclude></nowiki></code> tags is transcluded on the target page, and also appears on the source page.  
 
* <code><nowiki><onlyinclude></nowiki></code> - Content within the <code><nowiki>‎&lt;onlyinclude> &lt;/onlyinclude></nowiki></code> tags is transcluded on the target page, and also appears on the source page.  
  
'''Examples:'''
+
'''Pages using Translcusion'''
 
* [[Help:Transclusion]]
 
* [[Help:Transclusion]]
* [[Player]] transclude the list from [[Player API]]
+
* the list from [[Player API]] is transcluded to the [[Player]]  
* [[Macro Guide]] is such a large page, it have multiple sections transcluded from other pages, such as [[Markdown]] & [[Order of Operations]]
+
* [[Macro Guide]] is such a large page, it have multiple sections transcluded from other pages, such as [[Markdown]] & [[Order of Operations]], making it more modular and avoiding repetitions between pages.
* [[Building Character Sheets]] is another large page with some sections transcended.
+
** [[HTML Entities]] is a good example where content is transcluded selectively
 +
* [[Building Character Sheets]] is another large page with some sections transcluded from related pages
 
<noinclude>
 
<noinclude>
 
==Related Pages==
 
==Related Pages==

Revision as of 10:48, 11 August 2024

Main Page: Help:Contents

MediaWiki: Transclusion - include parts of one page into another page, which avoids needing to update several pages if they have a shared section transcluded from a separate page.

If a large page has sections transcluded to a sub-page, it also makes it easier to link & redirect to the section if it exists on a separate page. Transclusion can be used to show a condensed part of one page/topic on a bigger page, giving the important parts in the bigger page, but

Transclude existing page To add the content of an another page to the page you're editing, you transclude it by adding {{:Name of Page}} to the spot where you want it.

For example, to transclude the content of Help:Transclusion to the middle of your current page that has content before and after:

==Lorem ipsum==
Taciti leo ac urna facilisi tempus feugiat mattis quisque. Nullam auctor arcu, aliquam amet nisl tortor.

==Transclusion==
{{:Help:Transclusion}}

==Other Stuff==
Odor amet, consectetuer adipiscing elit. Hac turpis fames netus augue tincidunt nunc, turpis est.


Adjusting what parts of a page gets transcluded If non of the below elements are added to a page, everything will be included if it gets transcluded, including categories, all templates used, and miscellaneous stuff like links to related pages if it has something like it.

  • <noinclude> - Content within the <noinclude> ‎</noinclude> tags is excluded from transclusion on the target page. This content still appears on the source page.
  • <includeonly> - Content within the <includeonly> </includeonly>‎ tags is transcluded on the target page, but does not appear on the source page.
  • <onlyinclude> - Content within the ‎<onlyinclude> </onlyinclude> tags is transcluded on the target page, and also appears on the source page.

Pages using Translcusion

Related Pages