Template:Colored box: Difference between revisions
mNo edit summary |
No edit summary |
||
(15 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
<div class="mw-tpl-colorbox {{{class|}}}" style=" |
|||
<div style="box-shadow: 0 0 0.2em #999999; border-radius: 0.2em; margin: 0.5em 0.5em 1em 0.5em; background: {{{background-content-color|#fff}}}; {{{style|}}};"> |
|||
{{#if: {{{background-content-color|}}} |
|||
| background-color: {{{background-content-color|#fff}}}; |
|||
<div style="background: {{{background-title-color|#eaecf0}}}; border-radius: 0.2em 0.2em 0 0; padding: 0.5em 1em 0.5em 1em;">{{#if:{{{icon|}}}|<span style="opacity: 0.8;">[[File:{{{icon}}}|20px|link=|alt=]]</span> }}<span style="color: {{{title-color|#000000}}}; font-weight: bold;">{{{title}}}</span><!-- |
|||
}} |
|||
⚫ | |||
{{{style|}}} |
|||
"><templatestyles src="Colored box/style.css"/><!-- |
|||
--><div class="mw-tpl-colorbox-title {{#if: {{{title-link|}}} | mw-tpl-colorbox-title--linked }}" style=" |
|||
{{#if: {{{background-title-color|}}} |
|||
| background-color: {{{background-title-color|#eaecf0}}}; |
|||
}} |
|||
{{#if: {{{title-color|}}} | color: {{{title-color|#000000}}}; }}" |
|||
">{{#if: {{{icon|}}} | [[File:{{{icon}}}|20px|class=mw-tpl-colorbox-title-icon|link={{{title-link|}}}|alt=]]  }}<!-- |
|||
-->{{#if: {{{title-link|}}} | [[{{{title-link|}}}|<strong>{{{title}}}</strong>]] | <strong>{{{title}}}</strong> }}<!-- |
|||
-->{{#if: {{{view-link|{{{link|}}}}}} |
|||
⚫ | |||
|{{#if: {{{view-extlink|{{{link2|}}}}}} |
|||
|<div class="mw-tpl-colorbox-title-corner">[{{{view-extlink|{{{link2|}}}}}} <span style="{{#if: {{{link-color|{{{title-color|}}}}}} | color: {{{link-color|{{{title-color|}}}}}}; }}">{{{view-text|view}}}</span>]</div> |
|||
}} |
|||
}} |
|||
</div><!-- |
|||
--><div class="mw-tpl-colorbox-content"> |
|||
⚫ | |||
</div> |
</div> |
||
<!-- CSS for the content --> |
|||
<div style="padding: 0.5em 1em 0.5em 1em; border-radius: 0 0 0.2em 0.2em;"> |
|||
⚫ | |||
</div><noinclude> |
</div><noinclude> |
||
{{documentation}} |
{{documentation}} |
||
[[Category:Templates]] |
|||
</noinclude> |
</noinclude> |
Latest revision as of 14:51, 11 September 2023
{{{content}}}
This template uses TemplateStyles: |
This template is for community pages
Parameter | Description | Type | Status | |
---|---|---|---|---|
background-content-color | background-content-color | no description | Unknown | optional |
extra classes | class | 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. | Line | optional |
extra styles | style | 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. | Line | optional |
background-title-color | background-title-color | no description | Unknown | optional |
icon | icon | no description | File | optional |
Title text | title | no description | String | required |
Title link | title-link | Turn title area into a clickable link | Page name | optional |
title-color | title-color | no description | String | optional |
view-link | view-link link | Create a "view" corner link to a given page. | Page name | optional |
view-extlink | view-extlink link2 | Create a "view" corner link to a external URL. This cannot be used together with "view-link". | URL | optional |
view-text | view-text | Replace link text for "view-link" with something other than "view". | String | optional |
link-color | link-color | no description | Unknown | optional |
Content | content | no description | Content | required |
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 is imported from mw:Template:Colored box.
- This template was originally based on w:en:Template:Colored box.