الفرق بين النسختين بتاع: «وحدة:Category handler/شرح»

تم حذف المحتوى تمت إضافة المحتوى
ابتدا صفحه جديده بـ '{{documentation subpage}} {{#ifeq: {{FULLPAGENAME}} | Template:Category handler | {{high-risk| approximately 2840000 }}{{used in system}} }} {{lua|Module:Cat...'
 
ص Bot: Replace deprecated <source> tag and "enclose" parameter [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html]
 
سطر 29:
This template takes two or more parameters. Here's an example with the full template code for an article message box:
 
<sourcesyntaxhighlight lang="xml">
{{Ambox
| text = This is a box used in articles.
سطر 39:
<!--Add categories to the /doc subpage-->
</noinclude>
</syntaxhighlight>
</source>
 
The above example uses the default settings for {{tlf|category handler}}. That means the box will categorize on pages in the following namespaces:
سطر 56:
This template takes one or more parameters named after the different page types as listed in section [[#Namespaces|namespaces]] above. By using those parameters you can specify exactly in which namespaces your template should categorize. Like this:
 
<sourcesyntaxhighlight lang="xml">
{{mbox
| text = This is a box for articles and talk pages.
سطر 64:
| nocat = {{{nocat|}}} <!--So "nocat=true" works-->
}}
</syntaxhighlight>
</source>
 
The above box will only categorize in main and talk space. But it will not categorize on /archive pages since they are blacklisted. (See section [[#Blacklist|blacklist]] below.) And if you need to demonstrate (discuss) that box on a talkpage, then you can feed "<code>nocat=true</code>" to prevent that template from categorizing. (See section [[#The_%22nocat%22_parameter|The "nocat" parameter]] below.) Like this:
 
<sourcesyntaxhighlight lang="moin">
== My new template ==
Hey guys, have you seen my new template?
سطر 74:
Nice, isn't it?
--~~~~
</syntaxhighlight>
</source>
 
Sometimes we want to use the same category in several namespaces, then do like this:
 
<sourcesyntaxhighlight lang="xml">
{{mbox
| text = This is a box used in several namespaces.
سطر 90:
| nocat = {{{nocat|}}} <!--So "nocat=true/false" works-->
}}
</syntaxhighlight>
</source>
 
In the above example we use a numbered parameter to feed one of the categories, and then we tell this template to use that numbered parameter for both the help and user space.
سطر 102:
This template also has a parameter called '''all'''. It works like this:
 
<sourcesyntaxhighlight lang="xml">
{{mbox
| text = This is a box used in all namespaces.
سطر 109:
| nocat = {{{nocat|}}} <!--So "nocat=true/false" works-->
}}
</syntaxhighlight>
</source>
 
The above example will categorize in all namespaces, but not on blacklisted pages. If you want to demonstrate that box on a page, then use "<code>nocat=true</code>" to prevent the template from categorizing.
سطر 117:
The all parameter can also be combined with the rest of the parameters. Like this:
 
<sourcesyntaxhighlight lang="xml">
{{mbox
| text = This is a box used in all namespaces.
سطر 126:
| nocat = {{{nocat|}}} <!--So "nocat=true/false" works-->
}}
</syntaxhighlight>
</source>
 
If the above box is placed on an article, then it will add the categories "Somecat1" and "Somecat2". But on all other types of pages it will instead add "Somecat1" and "Somecat3". As the example shows, the all parameter works independently of the rest of the parameters.