Template:Messagebox/doc: Difference between revisions
Created page with " This template is for generating nicely formatted message boxes in articles, or even other templates. == Usage == The template takes three named parameters that can be given in any order. ; text : (required) is the message ; type : (optional) determines the presentation using pre-defined styling. One of :* success - to indicate what success means :* warning - to alert the user about preventing problems :* failure - to dialog about when something fails :* restricted - sh..." |
No edit summary |
||
| Line 60: | Line 60: | ||
| text = You must be a registered user to create or edit articles. Contact the [[User:Freephile|WikiSysop]] for an account! | | text = You must be a registered user to create or edit articles. Contact the [[User:Freephile|WikiSysop]] for an account! | ||
}} | }} | ||
== Making this template == | == Making this template == | ||
To generate the resized images from svg | To generate the resized images from svg | ||
[[Image:Dialog-error.svg| | [[Image:Dialog-error.svg|20px]] | ||
[[Image:Dialog-warning.svg| | [[Image:Dialog-warning.svg|20px]] | ||
[[Image:Dialog-ok-apply.svg | [[Image:Dialog-ok-apply.svg|20px]] | ||
[[Image:Dialog-information.svg| | [[Image:Dialog-information.svg|20px]] | ||
[[Image:Dialog-cancel.svg| | [[Image:Dialog-cancel.svg|20px]] | ||
[[Image:Dialog-password.svg| | [[Image:Dialog-password.svg|20px]] | ||
The parser code (how to do switch statements) is based on the example of the Ambox template from Mediawiki | The parser code (how to do switch statements) is based on the example of the Ambox template from Mediawiki | ||
The | The CSS is added to {{PAGENAME}}/styles.css to make this template complete by incorporating the TemplateStyles extension. | ||
<syntaxhighlight lang="css"> | |||
< | |||
.message-box { | .message-box { | ||
font-family: Verdana, Arial, Helvetica, sans-serif; | font-family: Verdana, Arial, Helvetica, sans-serif; | ||
| Line 104: | Line 100: | ||
border:1px solid #8FD500; | border:1px solid #8FD500; | ||
background-color:#F2FFD7; | background-color:#F2FFD7; | ||
padding-left: 32px; | padding-left: 32px; | ||
} | } | ||
| Line 112: | Line 107: | ||
border:1px solid #DD3C10; | border:1px solid #DD3C10; | ||
background-color:#FFEBE8; | background-color:#FFEBE8; | ||
padding-left: 32px; | padding-left: 32px; | ||
} | } | ||
| Line 120: | Line 114: | ||
border: 1px solid #ff9900; | border: 1px solid #ff9900; | ||
background-color:#fbf8c7; | background-color:#fbf8c7; | ||
padding-left: 32px; | padding-left: 32px; | ||
} | } | ||
| Line 126: | Line 119: | ||
font-weight:normal; | font-weight:normal; | ||
color: #333; | color: #333; | ||
padding-left: 32px; | padding-left: 32px; | ||
} | } | ||
</ | </syntaxhighlight> | ||
[[Category:Templates using ParserFunctions]] | [[Category:Templates using ParserFunctions]] | ||