Template:Ombox: Difference between revisions
(Created page with "{{#ifeq:{{{small|}}}|yes | {{ombox/core | small = yes | type = {{{type|}}} | image = {{#if:{{{smallimage|}}}| {{{smallimage}}} | {{{image|}}} }} | imageright = {{#if:{{{smallimageright|}}} | {{{smallimageright}}} | {{{imageright|}}} }} | class = {{{class|}}} | style = {{{style|}}} | textstyle = {{{textstyle|}}} | text = {{#if:{{{smalltext|}}}| {{{smalltext}}} | {{{text}}} }} }} | {{ombox/core | type = {{{type|}}} | image = {{{image|}}} | imager...") |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
| {{ombox/core | | {{ombox/core | ||
| small = yes | | small = yes | ||
| type = {{{type|}}} | | type = {{{type|notice}}} | ||
| image = {{#if:{{{smallimage|}}}| {{{smallimage}}} | {{{image| | | image = {{#if:{{{smallimage|}}}| {{{smallimage}}} | {{{image|[[File:Imbox notice.png|30x30px|link=|alt=]]}} }} | ||
| imageright = {{#if:{{{smallimageright|}}} | {{{smallimageright}}} | {{{imageright|}}} }} | | imageright = {{#if:{{{smallimageright|}}} | {{{smallimageright}}} | {{{imageright|}}} }} | ||
| class = {{{class|}}} | | class = {{{class|}}} | ||
| style = {{{style|}}} | | style = {{{style|}}} | ||
| textstyle = {{{textstyle|}}} | | textstyle = {{{textstyle|}}} | ||
| text = {{#if:{{{smalltext|}}}| {{{smalltext}}} | {{{text}}} }} | | text = {{#if:{{{smalltext|}}}| {{{smalltext|This is a small notice message box.}}} | {{{text|This is a notice message box.}}} }} | ||
}} | }} | ||
| {{ombox/core | | {{ombox/core | ||
| type = {{{type|}}} | | type = {{{type|notice}}} | ||
| image = {{{image|}}} | | image = {{{image|[[File:Imbox notice.png|40x40px|link=|alt=]]}}} | ||
| imageright = {{{imageright|}}} | | imageright = {{{imageright|}}} | ||
| class = {{{class|}}} | | class = {{{class|}}} | ||
| style = {{{style|}}} | | style = {{{style|}}} | ||
| textstyle = {{{textstyle|}}} | | textstyle = {{{textstyle|}}} | ||
| text = {{{text}}} | | text = {{{text|This is a notice message box.}}} | ||
}} | }} | ||
}}<noinclude>{{documentation}} | }} | ||
<noinclude>{{documentation}}</noinclude> | |||
Latest revision as of 14:00, 21 July 2024
|
|
This is a notice message box. |
Usage
The `{{Ombox}}` template is used to create message boxes with a variety of options for customization. It supports both regular and smaller-sized message boxes.
Parameters
- `type`: The type of message box (e.g., notice, warning, error, success, etc.). This parameter is required.
- `image`: The image to be displayed on the left side of the message box. Optional.
- `imageright`: An optional image to be displayed on the right side of the message box. Optional.
- `class`: Additional CSS classes for styling. Optional.
- `style`: Custom inline styles for the message box. Optional.
- `textstyle`: Custom inline styles for the text within the message box. Optional.
- `text`: The main text content of the message box. This parameter is required.
- `small`: If set to `yes`, a smaller version of the message box is created. Optional.
- `smallimage`: An image specifically for the small version of the message box. Optional.
- `smallimageright`: An image on the right side for the small version of the message box. Optional.
- `smalltext`: The text content for the small version of the message box. If not provided, the `text` parameter is used. Optional.
Examples
Basic Usage
This example shows a basic usage of the `{{Ombox}}` template:
{{Ombox
| type = notice
| text = This is a notice message.
}}
|
|
This is a notice message. |
Using Images
You can add an image to the message box:
{{Ombox
| type = warning
| image = [[File:Example.png|40px]]
| text = This is a warning with an image.
}}
|
|
This is a warning with an image. |
Smaller Version
This example shows how to use the smaller version of the message box:
{{Ombox
| small = yes
| type = error
| text = This is a small error message.
}}
{
[[File:
|
This is a small error message. |
Custom Styles
You can customize the styles of the message box:
{{Ombox
| type = success
| style = background-color: #DFF2BF;
| textstyle = color: green;
| text = This is a success message with custom styles.
}}
|
|
This is a success message with custom styles. |
See Also
- `{{Ambox}}` – For article message boxes.
- `{{Tmbox}}` – For talk page message boxes.
- `{{Imbox}}` – For image message boxes.
- `{{Fmbox}}` – For file message boxes.
Template Data
This template uses TemplateData for use with the VisualEditor and other tools.
A template to create message boxes with customizable content and styles.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| type | type | The type of message box (e.g., notice, warning, error, success). | String | required |
| text | text | The main text content of the message box. | String | required |
| image | image | The image to be displayed on the left side of the message box. | String | optional |
| imageright | imageright | An image to be displayed on the right side of the message box. | String | optional |
| class | class | Additional CSS classes for styling. | String | optional |
| style | style | Custom inline styles for the message box. | String | optional |
| textstyle | textstyle | Custom inline styles for the text within the message box. | String | optional |
| small | small | If set to 'yes', a smaller version of the message box is created. | String | optional |
| smallimage | smallimage | An image specifically for the small version of the message box. | String | optional |
| smallimageright | smallimageright | An image on the right side for the small version of the message box. | String | optional |
| smalltext | smalltext | The text content for the small version of the message box. | String | optional |