Template:Tranclude: Difference between revisions

From OLPC
Jump to navigation Jump to search
(copy from Sugar Labs wiki)
 
No edit summary
 
Line 1: Line 1:
<div style="border:1px solid orange; margin:0px; padding-left:6px; padding-right:6px; background-color:lightyellow;"><div class="NavFrame {{{collapsed|}}}"><div class="NavHead">{{{note|<small>'''Note:''' The contents of this section have been transcluded from another page, [[{{{1}}}]]:</small>}}} </div><div class="NavContent">{{#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>
<div style="border:1px solid orange; margin:0px; padding-left:6px; padding-right:6px; background-color:lightyellow;"><div class="NavFrame {{{collapsed|}}}"><div class="NavHead" style="align: left">{{{note|<small>'''Note:''' The contents of this section have been transcluded from another page, [[{{{1}}}]]:</small>}}} </div><div class="NavContent" style="align: left">{{#if: {{{interwikiprefix|}}}|<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 align:left"></div><h1>[[{{{1}}}]]</h1>}}<div style="clear:both align:left"></div>{{:{{{1}}}}}</div></div></div><includeonly>[[Category:Page with transclusion]]</includeonly><noinclude>
[[Category:Template]]__NOTOC__
[[Category:Template]]__NOTOC__


Line 21: Line 21:
#* 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.
#* 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>.
#* To hide the page title header, enter <code><nowiki><nowiki></nowiki></nowiki></code>.
# '''olpc'''
# '''interwikiprefix'''
#* Default: (empty string) - no effect.
#* 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.
#* Entering any non-whitespace text will be used with the <nowiki>{{#if:</nowiki> parser function to bring in the designated Wiki logo image ahead of the transclusion (currently limited to the OLPC wiki). In future versions, we may migrate to using a widget to embed a page from the source wiki in a frame that would serve to preserve the source formating and context.




Line 32: Line 32:


The example wiki text below produces this transclusion:
The example wiki text below produces this transclusion:
<nowiki>{{Transclude|olpc:Community Jabber Servers|olpc=1}}</nowiki>
<nowiki>{{Transclude|olpc:Community Jabber Servers|interwikiprefix=olpc}}</nowiki>
{{Transclude|olpc:Community Jabber Servers|olpc=1}}
{{Transclude|Community Jabber Servers|interwikiprefix=olpc}}


See http://wiki-devel.sugarlabs.org/go/Template:Transclude for the appearance of this page with interwiki transclusion enabled.
See http://wiki-devel.sugarlabs.org/go/Template:Transclude for the appearance of this page with interwiki transclusion enabled.

Latest revision as of 18:25, 13 March 2010

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=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. interwikiprefix
    • Default: (empty string) - no effect.
    • Entering any non-whitespace text will be used with the {{#if: parser function to bring in the designated Wiki logo image ahead of the transclusion (currently limited to the OLPC wiki). In future versions, we may migrate to using a widget to embed a page from the source wiki in a frame that would serve to preserve the source formating and context.


Example syntax:

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

The example wiki text below produces this transclusion:

{{Transclude|olpc:Community Jabber Servers|interwikiprefix=olpc}}

Template:Community Jabber Servers

See http://wiki-devel.sugarlabs.org/go/Template:Transclude for the appearance of this page with interwiki transclusion enabled.