قالب:Pp-meta
من ويكيبيديا، الموسوعة الحرة
| هذا القالب مصمم على نحو معقد.
يلزمك إدراك إعداداته واصطلاحاته قبل تعديله. إذا تسبب تعديلك للقالب في وقوع خلل فيه، سارع إلى إلغائه، فلربما ظهرت لذلك نتائج مستفسدة في الصفحات التي يستعمل فيها.
اعلم أن بإمكانك تجربة تعديل القالب: إما في ملعبه، أو ملعبك أو ملعب ويكيبيديا. |
This is {{pp-meta}}, a meta template used to create protection message boxes.
- If on an article (main space) it generates a message box in the standardised article message box style.
- If on any kind of talk page it generates a message box in the standardised talk page "coffee roll" style.
- If on any other page it generates a message box in the old protection template style.
This meta template also takes care of part of the code for the "small" case with just an icon at the top right corner of the page.
Note:
If these two boxes don't look alike, you need to refresh your web browser cache:
| - | Box generated by {{pp-meta}}. |
| - | Hardcoded box. |
This is a temporary caching problem that should be gone in some days.
[عدل] Examples
Note that the small padlock in the top right corner of this page also is an example created with this meta template.
[عدل] Main space
| This page is currently protected from editing . (protection log). رجاء ناقش أي تعديلات تود القيام بها في صفحة النقاش أو في صفحة إخطار الإداريين. |
[عدل] Any talk space
[عدل] Other spaces
[عدل] Usage
{{pp-meta
| smalltext = <imagemap> </imagemap>
| image = [[ملف:Padlock.svg|40px]]
| text = The message body text.
| categories = {{{categories|Any categories the child template should place on the target page, with ParserFunctions if desired.}}}
}}
[عدل] Parameters
smalltext
- Should be empty or undefined if the normal big message box is wanted. If non-empty it puts the data it gets in the upper right corner of the page. Feed the imagemap with all its content for the small padlock in the upper right corner. For instance:
<imagemap> ملف:Padlock-silver-medium.svg|20px rect 0 0 1000 1000 [[Wikipedia:Protection policy | This high-risk template has been semi-protected from editing to prevent vandalism]] desc none </imagemap>
image
- The image to use for the big message box. Usual wiki image notation and should be about 40px size. For instance:
[[ملف:Padlock.svg|40px]]
text
- The message body text.
demospace
- Main / Talk / Other = Manually set namespace. Only for testing and demonstration purposes. If empty or undefined then the namespace is detected automatically.
categories
- This parameter is designed to support category suppression, such that if
categories=nois passed, the template will not return categories. It should be used to insert the categories that will be placed upon the page where the template is transcluded. For use in a child template, wrap the categories in {{{categories| }} to allow the input "no" to be made to the child template. This parameter should never have non-category, non-invisible content passed, as this will display under and outside the template box.
[عدل] Technical details
- smalltext
The reason the smalltext has to get the whole imagemap as parameter instead of creating it based on the image and a text parameter is that MediaWiki can not handle template variables inside an imagemap.
- categories
<includeonly>{{#ifeq:{{{categories|no}}}|no||{{{categories|}}}}}</includeonly>
- This code first evaluates if
categoriesis equal to "no". If so, it cancels the display of a pp-template's article categories at each level. If not, it displays the values if and only if present. - It is offset with includeonly tags to only be made effective at the transcluded level - that is, wherever the template is placed, so will its categories.
|categories={{{categories|Foo}}
- Where
Foois in the example is where the categories that one wants the calling template to display should be placed. These can also use ParserFunctions to be disabled where desired (i.e. expiry-enabled categories that appear once the current article is unprotected again). - Any template calling pp-meta should use the form
<includeonly>{{pp-meta}}</includeonly>(where the pp-meta transclusion includes parameters), so categories placed as the calling template's default forcategorieswill be transcluded only to the protected page where the calling template is transcluded, rather than to the calling template itself.
[عدل] انظر أيضا
- Wikipedia:Template messages/Maintenance#Protected articles, pages and images – Examples of all the current protection templates.
- Wikipedia:Article message boxes – The (proposed) style guideline for creating article message boxes.
- Wikipedia talk:Article message boxes – For discussion about these matters.
- Wikipedia:Talk page templates – For the "coffee roll" standard used in talk page templates.
| التوثيق أعلاه مضمن من قالب:Pp-meta/شرح. (عدل | تاريخ) يمكن لك أن تجرب أي تغيير في القالب في الملعب (عدل | فرق) ثم تختبر استعماله في المختبر (أنشئ). تفضل بإضافة التصانيف ووصلات الإنترويكي إلى صفحة /شرح الفرعية. صفحات القالب الفرعية. |