Difference between revisions of "Template:Transclude"

From Sugar Labs
Jump to navigation Jump to search
(update collapsible code. See Wiki Team/Guide/Collapsible content.)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div style="border:1px solid orange; margin:0px; padding-left:6px; padding-right:6px; background-color:lightyellow;">
+
<div style="border:1px solid orange; margin:0px; padding-left:6px; padding-right:6px; background-color:lightyellow;"><div class="mw-collapsible {{{collapsed|}}}" data-collapsetext="hide&nbsp;▲" data-expandtext="show&nbsp;▼">{{{note|<small>'''Note:''' The contents of this section have been transcluded from another page, [[{{{1}}}]]:</small>}}} <div class="mw-collapsible-content">{{#if: {{{olpc|}}}|<span class="plainlinks" style="clear:left; float: left; margin: .5em 1.7em .5em 0; background: white;">[http://wiki.laptop.org/go/The_OLPC_Wiki http://wiki.laptop.org/skins/common/images/OLPC_wiki_logo.png]</span>|}}{{#if: {{{heading|}}}|{{{heading}}}|<div style="clear:both"></div><h1>[[{{{1}}}]]</h1>}}<div style="clear:both"></div>{{:{{{1}}}}}</div></div></div><includeonly>[[Category:Page with transclusion]]</includeonly><noinclude>
<small>{{{note|'''Note:''' The contents of this section have been transcluded from [[{{{1}}}|another page]]:}}}</small><br>
+
[[Category:Template]]__NOTOC__
{{#if: {{{olpc|}}}|<span class="plainlinks">[http://wiki.laptop.org/go/The_OLPC_Wiki http://wiki.laptop.org/skins/common/images/OLPC_wiki_logo.png]</span>|}}<h1>[[{{{1}}}]]</h1>{{:{{{1}}}}}</div><includeonly>[[Category:Page with transclusion]]</includeonly><noinclude>
 
[[Category:Template]]
 
  
 
The purpose of this template is to reveal those sections of pages that come from transcluded pages.  Pages using this template will be included in the [[:Category:Page with transclusion]] and will display the contents of the transcluded page in a lightyellow color as a reminder of its off-page source.
 
The purpose of this template is to reveal those sections of pages that come from transcluded pages.  Pages using this template will be included in the [[:Category:Page with transclusion]] and will display the contents of the transcluded page in a lightyellow color as a reminder of its off-page source.
  
 
==Usage==
 
==Usage==
The template takes two optional parameters
+
The template takes 1 required,
 +
# '''wiki page title'''
 +
#* Enter the local ''wiki page title'' (or ''interwiki prefix:remote title'', if interwiki transclusion is allowed by the administrators).
 +
 
 +
 
 +
and 4 optional parameters:
 +
# '''collapsed'''
 +
#* Default: (empty string) - This shows the transcluded page.
 +
#* Enter <code>collapsed=mw-collapsed</code> to have the transcluded page collapsed on page load (if javascript is enabled).
 
# '''note'''
 
# '''note'''
#* Can be any text, which will be displayed before the transclusion in place of the default: '''Note:''' The contents of this section have been transcluded from <nowiki>[[{{{1}}}|another page]]:</nowiki>
+
#* Default: <nowiki><small>'''Note:''' The contents of this section have been transcluded from another page, [[{{{1}}}]]:</small></nowiki>
 +
#* You may enter any text, which will be displayed before the transclusion in place of the default.
 +
# '''heading'''
 +
#* Default: (empty string) - This shows the page title heading above the transclusion (by means of this wikicode, <nowiki><h1>[[{{{1}}}]]</h1></nowiki>.
 +
#* Entering any non-whitespace text will be used with the <nowiki>{{#if:</nowiki> parser function to replace the default page title heading with another block of introductory text.
 +
#* To hide the page title header, enter <code><nowiki><nowiki></nowiki></nowiki></code>.
 
# '''olpc'''
 
# '''olpc'''
#* any non-whitespace text, used with <nowiki>{{#if:</nowiki> parser function to bring in the OLPC Wiki image ahead of the transclusion. Default: (empty string).
+
#* Default: (empty string) - no effect.
 +
#* Entering any non-whitespace text will be used with the <nowiki>{{#if:</nowiki> parser function to bring in the OLPC Wiki logo image ahead of the transclusion.  
 +
 
  
 
Example syntax:
 
Example syntax:
 
<pre>
 
<pre>
{{Transclude|the transcluded wiki page|note=optional introductory text|olpc=1}}
+
{{Transclude|the transcluded wiki page|note=|heading=optional introductory text|collapsed=mw-collapsed}}
 
</pre>
 
</pre>
  
Line 21: Line 34:
 
  <nowiki>{{Transclude|olpc:Community Jabber Servers|olpc=1}}</nowiki>
 
  <nowiki>{{Transclude|olpc:Community Jabber Servers|olpc=1}}</nowiki>
 
{{Transclude|olpc:Community Jabber Servers|olpc=1}}
 
{{Transclude|olpc:Community Jabber Servers|olpc=1}}
 +
 +
==Limitation==
 +
* If the template is entered after a formatted indent such as *, #, :, the surrounding division frame will not capture the actual transclusion.
 
</noinclude>
 
</noinclude>

Latest revision as of 22:23, 6 November 2013

Note: The contents of this section have been transcluded from another page, [[{{{1}}}]]:

[[{{{1}}}]]

{{:{{{1}}}}}

The purpose of this template is to reveal those sections of pages that come from transcluded pages. Pages using this template will be included in the Category:Page with transclusion and will display the contents of the transcluded page in a lightyellow color as a reminder of its off-page source.

Usage

The template takes 1 required,

  1. wiki page title
    • Enter the local wiki page title (or interwiki prefix:remote title, if interwiki transclusion is allowed by the administrators).


and 4 optional parameters:

  1. collapsed
    • Default: (empty string) - This shows the transcluded page.
    • Enter collapsed=mw-collapsed to have the transcluded page collapsed on page load (if javascript is enabled).
  2. note
    • Default: <small>'''Note:''' The contents of this section have been transcluded from another page, [[{{{1}}}]]:</small>
    • You may enter any text, which will be displayed before the transclusion in place of the default.
  3. heading
    • Default: (empty string) - This shows the page title heading above the transclusion (by means of this wikicode, <h1>[[{{{1}}}]]</h1>.
    • Entering any non-whitespace text will be used with the {{#if: parser function to replace the default page title heading with another block of introductory text.
    • To hide the page title header, enter <nowiki></nowiki>.
  4. olpc
    • Default: (empty string) - no effect.
    • Entering any non-whitespace text will be used with the {{#if: parser function to bring in the OLPC Wiki logo image ahead of the transclusion.


Example syntax:

{{Transclude|the transcluded wiki page|note=|heading=optional introductory text|collapsed=mw-collapsed}}

The example wiki text below produces this transclusion:

{{Transclude|olpc:Community Jabber Servers|olpc=1}}
Note: The contents of this section have been transcluded from another page, olpc:Community Jabber Servers:
OLPC_wiki_logo.png

olpc:Community Jabber Servers

301 Moved Permanently

Moved Permanently

The document has moved here.


Apache/2.4.58 (Ubuntu) Server at wiki.laptop.org Port 80

Limitation

  • If the template is entered after a formatted indent such as *, #, :, the surrounding division frame will not capture the actual transclusion.