Difference between revisions of "Template:Transclusion"
(Tag: 2017 source edit) |
m (Tag: 2017 source edit) |
This template allows to transclude a page and add styling to the transcluded content with background, border and padding option.
The template file (Template:Transclusion) can be downloaded as part of the template package.
The following parameters can be set in visual editing mode:
Parameter | Description | Type | Status | |
---|---|---|---|---|
Page to transclude into this document | transcludedpage |
Add the full page name (including namespace if applicable)
|
Unknown | required |
Page section | section |
Include only a section of the page (enter the heading title)
|
Unknown | optional |
Color style | tcstyle |
Sets the background and border color. These colors can be overwritten individually with the border and background setting.
|
String | optional |
Background | tcbackground |
Overwrites the background value of the color style setting.
|
Unknown | optional |
Border | tcborder |
Overwrites the border value of the selected color style.
|
Unknown | optional |
Padding | tcpadding |
Overwrites the default padding of 0px
|
Unknown | optional |
<includeonly><templatestyles src="Transclusion/styles.css" /> <div class="tc {{#switch:{{{tcstyle}}}|grey=tcgrey|yellow=tcyellow|blue=tcblue|green=tcgreen|red=tcred}}" style="{{#if:{{{tcbackground|}}}| background:{{{tcbackground}}};|}}{{#if:{{{tcborder|}}}| border:{{{tcborder}}};|}}{{#if:{{{tcpadding|}}}| padding:{{{tcpadding}}};|}}">{{#if: {{{section|}}}|{{#dpl:title={{{transcludedpage}}}|include=#{{{section|}}}}}|{{ {{{transcludedpage}}} }} }}</div> {{#if: {{{section|}}}|{{#dpl:title={{{transcludedpage}}}|include=#{{{section|}}}}}|{{ {{{transcludedpage}}} }} }}</includeonly> <noinclude> This template allows to transclude a page and add styling to the transcluded content with background, border and padding option. The template file (''Template:Transclusion'') can be downloaded as part of the [[Manual:Template/Template package|template package]]. [[File:template-download-Transclusion.png|850x850px|center|alt=screenshot of transclusion template|thumb|Transclusion example]] <templatedata> { "params": { "transcludedpage": { "label": "Page to transclude into this document", "description": "Add the full page name (including namespace if applicable)", "required": true, "default": "Namespace:Pagename" }, "section": { "label": "Page section", "description": "Include only a section of the page (enter the heading title)" }, "tcstyle": { "label": "Color style", "description": "Sets the background and border color. These colors can be overwritten individually with the border and background setting.", "example": "grey,yellow,blue,green,red", "type": "string" }, "tcbackground": { "label": "Background", "description": "Overwrites the background value of the color style setting.", "autovalue": "#efefef" }, "tcborder": { "label": "Border", "description": "Overwrites the border value of the selected color style.", "autovalue": "1px solid #cccccc" }, "tcpadding": { "label": "Padding", "description": "Overwrites the default padding of 0px", "autovalue": "20px" } }, "description": "The following parameters can be set in visual editing mode:", "paramOrder": [ "transcludedpage", "section", "tcstyle", "tcbackground", "tcborder", "tcpadding" ] } </templatedata> </noinclude>
Line 1: | Line 1: | ||
<includeonly><templatestyles src="Transclusion/styles.css" /> | <includeonly><templatestyles src="Transclusion/styles.css" /> | ||
− | <div class="tc {{#switch:{{{tcstyle}}}|grey=tcgrey|yellow=tcyellow|blue=tcblue|green=tcgreen|red=tcred}}" style="{{#if:{{{tcbackground|}}}| background:{{{tcbackground}}};|}}{{#if:{{{tcborder|}}}| border:{{{tcborder}}};|}}{{#if:{{{tcpadding|}}}| padding:{{{tcpadding}}};|}}">{{#if: {{{section|}}}|{{#dpl:title={{{transcludedpage}}}|include=#{{{section|}}}}}|{{ {{{transcludedpage}}} }} }}</div> | + | <div class="tc {{#switch:{{{tcstyle}}}|grey=tcgrey|yellow=tcyellow|blue=tcblue|green=tcgreen|red=tcred}}" style="{{#if:{{{tcbackground|}}}| background:{{{tcbackground}}};|}}{{#if:{{{tcborder|}}}| border:{{{tcborder}}};|}}{{#if:{{{tcpadding|}}}| padding:{{{tcpadding}}};|}}">{{#if: {{{section|}}}|{{#dpl:title={{{transcludedpage}}}|include=#{{{section|}}}}}|{{ {{{transcludedpage}}} }} }}</div></includeonly> |
− | |||
− | |||
<noinclude> | <noinclude> | ||
This template allows to transclude a page and add styling to the transcluded content with background, border and padding option. | This template allows to transclude a page and add styling to the transcluded content with background, border and padding option. |