Vorlage:Cmbox/Doku: Unterschied zwischen den Versionen

Aus skandinavien-wiki.net
Keine Bearbeitungszusammenfassung
K (86 Versionen von wikivoyage:Vorlage:Cmbox/Doku importiert)
 
(40 dazwischenliegende Versionen von 25 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
{{Documentation subpage}}
{{Bitte um Übersetzung|en}}
<includeonly>{{intricate template}}</includeonly>
{{Dokumentation Unterseite}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
{{high-use}}
 
<!-- Kategorien bitte an das Ende der Seite, Interwiki-Links bitte nach Wikidata -->
{{mbox templates}}
{{mbox templates}}
This is the {{tl|cmbox}} or '''category message box''' meta-template.
This is the {{tl|cmbox}} or '''category message box''' meta-template.
Zeile 10: Zeile 12:


=== We are deploying! ===
=== We are deploying! ===
After long discussion on the [[Template talk:Cmbox|talk page]] of this template and at other places we are finally deploying this template. Feel free to convert any message boxes used on category pages to use this meta-template. If you find any tricky cases then list them on the talk page of this template and you'll get help.
After long discussion on the [[Template talk:Cmbox|talk page]] of this template and at other places we are finally deploying this template. Feel free to convert any message boxes used on category pages to use this meta-template. If you find any tricky cases then list them on the talk page of this template and you'll get help.


Zeile 16: Zeile 17:


=== Usage ===
=== Usage ===
Simple usage example:
Simple usage example:


Zeile 24: Zeile 24:


{{cmbox | text = Some text.}}
{{cmbox | text = Some text.}}


Complex example:
Complex example:
Zeile 47: Zeile 46:


=== Category message box types ===
=== Category message box types ===
The following examples use different '''type''' parameters but use no image parameters thus they use the default images for each type.
The following examples use different '''type''' parameters but use no image parameters thus they use the default images for each type.


Zeile 60: Zeile 58:
{{cmbox
{{cmbox
| type = content
| type = content
| text = type=<u>content</u> – Major warnings and problems, such as {{tl|CategorisationDisputedPeople}}.
| text = type=<u>content</u> – Major warnings and problems, such as {{tl|Categorisation of people disputed}}.
}}
}}
{{cmbox
{{cmbox
Zeile 66: Zeile 64:
| text = type=<u>style</u> – Minor warnings and problems, such as {{tl|popcat}}.
| text = type=<u>style</u> – Minor warnings and problems, such as {{tl|popcat}}.
}}
}}
<!--{{cmbox
| type = collaboration
| text = type=<u>collaboration</u> – Aufruf zur Mitarbeit.
}}-->
{{cmbox
{{cmbox
| type = notice
| type = notice
Zeile 78: Zeile 80:
| text = type=<u>protection</u> – Protection templates such as {{tl|pp-semi-protected}} when shown on a category page.
| text = type=<u>protection</u> – Protection templates such as {{tl|pp-semi-protected}} when shown on a category page.
}}
}}
<!--{{cmbox
| type = inuse
| text = type=<u>inuse</u> – '''Hinweis:''' Dieser Artikel wird gerade von jemand anderem in größerem Umfang bearbeitet. Um Überschneidungen zu vermeiden, warte bitte, bis dieser Text wieder entfernt und der Artikel freigegeben ist. Sollte dieser Hinweis älter als 24 Stunden sein, kannst du ihn entfernen und den Artikel bearbeiten..
}}-->


=== Other images ===
=== Other images ===
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the '''image''' parameter to specify an image other than the default images.
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the '''image''' parameter to specify an image other than the default images.


Zeile 95: Zeile 100:


=== Special ===
=== Special ===
Some other parameter combinations.
Some other parameter combinations.


Zeile 120: Zeile 124:


=== Parameters ===
=== Parameters ===
List of all parameters:
List of all parameters:


Zeile 128: Zeile 131:
| image = none / [[Image:Some image.svg|40px]]
| image = none / [[Image:Some image.svg|40px]]
| imageright = [[Image:Some image.svg|40px]]
| imageright = [[Image:Some image.svg|40px]]
| style = CSS value
| class = A custom CSS class to apply to the box
| textstyle = CSS value
| style = CSS values
| textstyle = CSS values
| text  = The message body text.  
| text  = The message body text.  
}}
}}
Zeile 139: Zeile 143:
'''image'''
'''image'''
:'''No parameter''' = If no '''image''' parameter is given the template uses a default image. Which default image it uses depends on the '''type''' parameter.  
:'''No parameter''' = If no '''image''' parameter is given the template uses a default image. Which default image it uses depends on the '''type''' parameter.  
:'''An image''' = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems.) For example:  
:'''An image''' = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:  
::<code><nowiki>image = [[Image:Sub-arrows.svg|40px]]</nowiki></code>
::<code><nowiki>image = [[Image:Sub-arrows.svg|40px]]</nowiki></code>
:'''none''' = Means that no image is used.
:'''none''' = Means that no image is used.
Zeile 145: Zeile 149:
'''imageright'''
'''imageright'''
:'''No parameter''' = If no '''imageright''' parameter is given then no image is shown on the right side.
:'''No parameter''' = If no '''imageright''' parameter is given then no image is shown on the right side.
:'''An image''' = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But on this side the message box can handle images of any size.) For example:  
:'''An image''' = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:  
::<code><nowiki>imageright = [[Image:Nuvola apps bookcase.png|40px]]</nowiki></code>
::<code><nowiki>imageright = [[Image:Nuvola apps bookcase.png|40px]]</nowiki></code>
:'''Anything''' = Any other object that you want to show on the right side.
:'''Anything''' = Any other object that you want to show on the right side.
Zeile 161: Zeile 165:


=== Technical details ===
=== Technical details ===
If you need to use special characters in the text parameter then you need to escape them like this:  
If you need to use special characters in the text parameter then you need to escape them like this:  


Zeile 181: Zeile 184:
</div>
</div>
}}
}}


This template uses the cmbox CSS classes in [[MediaWiki:Common.css]] for most of its looks, thus it is fully skinnable.
This template uses the cmbox CSS classes in [[MediaWiki:Common.css]] for most of its looks, thus it is fully skinnable.
Zeile 189: Zeile 191:
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.


For more technical details see the [[Template talk:Cmbox|talk page]]. Since this template works almost exactly like {{tl|ambox}} and {{tl|imbox}} their talk pages and related pages might also contain more details.
For more technical details see the [[Template talk:Cmbox|talk page]]. Since this template works almost exactly like the other mboxes their talk pages and related pages might also contain more details, see the "See also" section below.


=== See also ===
=== See also ===
{{Mbox templates see also}}


There are several meta-templates in the mbox family:
{{mbox template family}}
* {{tl|ambox}} – For article message boxes.
* {{tl|tmbox}} – For talk page message boxes.
* {{tl|imbox}} – For image page message boxes.
* {{tl|cmbox}} – For category message boxes.
* {{tl|ombox}} – For other pages message boxes.
* {{tl|mbox}} – Has namespace detection, for message boxes that are used on several types of pages and thus need to change style depending on what page they are used on.


<includeonly>
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
<!-- Kategorien bitte hier, Interwiki-Links bitte nach Wikidata -->
[[Category:Wikipedia metatemplates|{{PAGENAME}}]]
[[Kategorie:Vorlagen:Infoboxen]]
[[Category:Category namespace templates| ]]
 
[[hsb:Předłoha:Ombox]]
[[no:mal:Cmbox]]
[[mk:Шаблон:Cmbox]]
[[ka:თარგი:Cmbox]]
[[ro:Format:Meta-casetămc]]
[[uk:Шаблон:Cmbox]]
 
</includeonly>
</includeonly>

Aktuelle Version vom 27. Januar 2023, 06:59 Uhr

Gnome-emblem-important.svg
Diese Vorlage wird auf vielen Seiten verwendet
Um große Unterbrechungen und unnötige Serverauslastung zu vermeiden, solltest du Änderungen an anderer Stelle testen, indem du beispielsweise den Quellcode dieser Vorlage kopierst und in den Benutzerbereich oder in die Sandbox einfügst. Erwäge, deine Änderungen auf der Diskussionsseite vorzuschlagen, bevor du diese Vorlage bearbeitest.

This is the {{cmbox}} or category message box meta-template.

It is used to build message box templates for category pages, such as {{CatDiffuse}} etc. It offers several different colours, uses default images if no image parameter is given and it has some other features.

This template works almost exactly like {{ambox}} and uses the same parameters.

We are deploying!

After long discussion on the talk page of this template and at other places we are finally deploying this template. Feel free to convert any message boxes used on category pages to use this meta-template. If you find any tricky cases then list them on the talk page of this template and you'll get help.

When this template is used to build category message boxes those boxes should contain explanatory texts just like before. (The same texts as before or new improved texts.) If there are more specific images in the boxes or you know a better image, then use them instead of the default images shown here.

Usage

Simple usage example:

{{cmbox | text = Some text.}}

Complex example:

{{cmbox
| type      = style
| image     = [[Image:Emblem-question-yellow.svg|40px]]
| style     = width: 400px; 
| textstyle = color: red; font-weight: bold; font-style: italic;
| text      = The message body text.
}}

Category message box types

The following examples use different type parameters but use no image parameters thus they use the default images for each type.

Other images

The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.

Special

Some other parameter combinations.

Parameters

List of all parameters:

{{cmbox
| type  = speedy / delete / content / style / notice / move / protection
| image = none / [[Image:Some image.svg|40px]]
| imageright = [[Image:Some image.svg|40px]]
| class = A custom CSS class to apply to the box
| style = CSS values
| textstyle = CSS values
| text  = The message body text. 
}}

type

If no type parameter is given the template defaults to type notice. That means it gets a blue background.

image

No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
image = [[Image:Sub-arrows.svg|40px]]
none = Means that no image is used.

imageright

No parameter = If no imageright parameter is given then no image is shown on the right side.
An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
imageright = [[Image:Nuvola apps bookcase.png|40px]]
Anything = Any other object that you want to show on the right side.

style

An optional CSS value used by the entire message box table. Without quotation marks " ". For example:
style = margin-bottom: 0.5em;

textstyle

An optional CSS value used by the text cell. For example:
textstyle = text-align: center;

text

The message body text.

Technical details

If you need to use special characters in the text parameter then you need to escape them like this:

{{cmbox
| text  = <div>
Equal sign = and a start and end brace { } work fine as they are. 
But here is a pipe {{!}} and two end braces <nowiki>}}</nowiki>. 
And now a pipe and end braces <nowiki>|}}</nowiki>.
</div>
}}

This template uses the cmbox CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.

Internally this meta-template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta-templates since wiki markup has several drawbacks. For instance it makes it harder to use parser functions and special characters in parameters.

The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.

For more technical details see the talk page. Since this template works almost exactly like the other mboxes their talk pages and related pages might also contain more details, see the "See also" section below.

See also

There are seven metatemplates in the Module:Message box family:
  • {{Ambox}}, for messageboxes on article pages.
  • {{Cmbox}}, for messageboxes on category pages.
  • {{Imbox}}, for messageboxes on file (image) pages.
  • {{Tmbox}}, for messageboxes on talk pages.
  • {{Fmbox}}, for header and footer messageboxes.
  • {{Ombox}}, for messageboxes on other types of page.
  • {{Mbox}}, for messageboxes that are used in different namespaces and change their presentation accordingly.

Closely related metatemplates:

  • {{Asbox}}, for messageboxes in article stubs.
  • {{Dmbox}}, for messageboxes on disambiguation or set-index pages.
  • {{Ivmbox}}, a simple full-width box with default ivory background intended to frame important messages or notices.