Difference between revisions of "Template:Transclusion"
en>Mlink-rodrigue m |
(Tag: 2017 source edit) |
||
(2 intermediate revisions by the same user not shown) | |||
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></includeonly> | <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> |
Latest revision as of 18:42, 7 April 2021
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.
<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>