Template:Colored box/doc: Difference between revisions
en>Tacsipacsi uses TemplateStyles, add {{Documentation subpage}} |
m 14 revisions imported |
||
(8 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
{{Uses TemplateStyles|Template:Colored box/style.css}} | {{Uses TemplateStyles|Template:Colored box/style.css}} | ||
<templatedata> | <templatedata> | ||
{ | { | ||
"params": { | "params": { | ||
"background-content-color": {}, | "background-content-color": {}, | ||
"style": {}, | "class": { | ||
"label": "extra classes", | |||
"description": "Extra CSS classes to apply to the outermost box (space-separated). This is mainly for other templates using TemplateStyles so that they can scope their CSS to the box, but it may be useful in other cases as well.", | |||
"type": "line" | |||
}, | |||
"style": { | |||
"label": "extra styles", | |||
"description": "Extra inline CSS rules to apply to the outermost element. Prefer TemplateStyles and using CSS classes if possible when using this template in another template.", | |||
"type": "line" | |||
}, | |||
"background-title-color": {}, | "background-title-color": {}, | ||
"icon": { | "icon": { | ||
"type": "wiki-file-name", | "type": "wiki-file-name" | ||
" | }, | ||
"title-color": { | |||
"type": "string" | |||
}, | }, | ||
"title": { | "title": { | ||
"required": true | "required": true, | ||
"label": "Title text", | |||
"type": "string" | |||
}, | |||
"link-color": {}, | |||
"content": { | |||
"required": true, | |||
"label": "Content", | |||
"type": "content" | |||
}, | }, | ||
"link": { | "title-link": { | ||
"label": "Title link", | |||
"description": "Turn title area into a clickable link", | |||
"type": "wiki-page-name" | "type": "wiki-page-name" | ||
}, | }, | ||
"link- | "view-text": { | ||
" | "description": "Replace link text for \"view-link\" with something other than \"view\".", | ||
" | "type": "string" | ||
}, | |||
"view-link": { | |||
"aliases": [ | |||
"link" | |||
], | |||
"description": "Create a \"view\" corner link to a given page.", | |||
"type": "wiki-page-name" | |||
}, | |||
"view-extlink": { | |||
"aliases": [ | |||
"link2" | |||
], | |||
"description": "Create a \"view\" corner link to a external URL. This cannot be used together with \"view-link\".", | |||
"type": "url" | |||
} | } | ||
}, | }, | ||
Line 28: | Line 61: | ||
"fr": "Le modèle boîte colorée est conçu pour les pages communautaires. Il s'inspire de la page d'accueil de Wikidata. " | "fr": "Le modèle boîte colorée est conçu pour les pages communautaires. Il s'inspire de la page d'accueil de Wikidata. " | ||
}, | }, | ||
"format": "block" | "format": "block", | ||
"paramOrder": [ | |||
"background-content-color", | |||
"class", | |||
"style", | |||
"background-title-color", | |||
"icon", | |||
"title", | |||
"title-link", | |||
"title-color", | |||
"view-link", | |||
"view-extlink", | |||
"view-text", | |||
"link-color", | |||
"content" | |||
] | |||
} | } | ||
</templatedata> | </templatedata> | ||
Line 34: | Line 82: | ||
== Examples == | == Examples == | ||
=== Example: Title === | |||
<pre> | |||
{{Colored box|title=TITLE|content=CONTENT}} | {{Colored box|title=TITLE|content=CONTENT}} | ||
{{Colored box | |||
{{Colored box|title=TITLE|link=MediaWiki|content=CONTENT}} | |title=TITLE | ||
|title-link=MediaWiki | |||
{{Colored box|title=TITLE|link=MediaWiki| | |content=CONTENT | ||
}} | |||
</pre> | |||
{{Colored box|title=TITLE|content=CONTENT}} | |||
{{Colored box | |||
|title=TITLE | |||
|title-link=MediaWiki | |||
|content=CONTENT | |||
}} | |||
=== Example: View link === | |||
<pre> | |||
{{Colored box|title=TITLE|view-link=MediaWiki|content=CONTENT}} | |||
{{Colored box|title=TITLE|view-link=MediaWiki|view-text=HELLO|content=CONTENT}} | |||
{{Colored box|title=TITLE|view-extlink=https://mediawiki.org|view-text=HELLO|content=CONTENT}} | |||
</pre> | |||
{{Colored box|title=TITLE|view-link=MediaWiki|content=CONTENT}} | |||
{{Colored box|title=TITLE|view-link=MediaWiki|view-text=HELLO|content=CONTENT}} | |||
{{Colored box|title=TITLE|view-extlink=https://mediawiki.org|view-text=HELLO|content=CONTENT}} | |||
=== Example: Everything === | |||
Icon, title link, custom view-link text | |||
<pre> | |||
{{Colored box | |||
|icon=OOjs_UI_icon_download-progressive.svg | |||
|title=TITLE | |||
|title-link=MediaWiki | |||
|view-link=MediaWiki | |||
|view-text=HELLO | |||
|content=CONTENT | |||
}} | |||
</pre> | |||
{{Colored box | |||
|icon=OOjs_UI_icon_download-progressive.svg | |||
|title=TITLE | |||
|title-link=MediaWiki | |||
|view-link=MediaWiki | |||
|view-text=HELLO | |||
}} | |||
== See also == | |||
* This template was originally based on [[:w:en:Template:Colored box]]. |
Latest revision as of 09:26, 8 April 2024
This is a documentation subpage for Template:Colored box. It contains usage information, categories and other content that is not part of the original Template page. |
[[Category:Template documentation pages{{#translation:}}]]
This template uses TemplateStyles: |
<templatedata> { "params": { "background-content-color": {}, "class": { "label": "extra classes", "description": "Extra CSS classes to apply to the outermost box (space-separated). This is mainly for other templates using TemplateStyles so that they can scope their CSS to the box, but it may be useful in other cases as well.", "type": "line" }, "style": { "label": "extra styles", "description": "Extra inline CSS rules to apply to the outermost element. Prefer TemplateStyles and using CSS classes if possible when using this template in another template.", "type": "line" }, "background-title-color": {}, "icon": { "type": "wiki-file-name" }, "title-color": { "type": "string" }, "title": { "required": true, "label": "Title text", "type": "string" }, "link-color": {}, "content": { "required": true, "label": "Content", "type": "content" }, "title-link": { "label": "Title link", "description": "Turn title area into a clickable link", "type": "wiki-page-name" }, "view-text": { "description": "Replace link text for \"view-link\" with something other than \"view\".", "type": "string" }, "view-link": { "aliases": [ "link" ], "description": "Create a \"view\" corner link to a given page.", "type": "wiki-page-name" }, "view-extlink": { "aliases": [ "link2" ], "description": "Create a \"view\" corner link to a external URL. This cannot be used together with \"view-link\".", "type": "url" } }, "description": { "en": "This template is for community pages", "fr": "Le modèle boîte colorée est conçu pour les pages communautaires. Il s'inspire de la page d'accueil de Wikidata. " }, "format": "block", "paramOrder": [ "background-content-color", "class", "style", "background-title-color", "icon", "title", "title-link", "title-color", "view-link", "view-extlink", "view-text", "link-color", "content" ] } </templatedata>
Examples
Example: Title
{{Colored box|title=TITLE|content=CONTENT}} {{Colored box |title=TITLE |title-link=MediaWiki |content=CONTENT }}
CONTENT
CONTENT
Example: View link
{{Colored box|title=TITLE|view-link=MediaWiki|content=CONTENT}} {{Colored box|title=TITLE|view-link=MediaWiki|view-text=HELLO|content=CONTENT}} {{Colored box|title=TITLE|view-extlink=https://mediawiki.org|view-text=HELLO|content=CONTENT}}
CONTENT
CONTENT
CONTENT
Example: Everything
Icon, title link, custom view-link text
{{Colored box |icon=OOjs_UI_icon_download-progressive.svg |title=TITLE |title-link=MediaWiki |view-link=MediaWiki |view-text=HELLO |content=CONTENT }}
See also
- This template was originally based on w:en:Template:Colored box.