Template:Categorize: Difference between revisions

From HorizonXI Wiki
(Created page with "<includeonly>{{#switch:{{lc:{{{1|}}}}}|no categories|no cat|nc = |#default = {{#ifeq:{{NAMESPACE}}||{{{2|}}}}}}}</includeonly>")
Tag: visualeditor-wikitext
 
m (added chatgpt interpreted documentation on template behavior)
Line 1: Line 1:
<includeonly>{{#switch:{{lc:{{{1|}}}}}|no categories|no cat|nc = |#default = {{#ifeq:{{NAMESPACE}}||{{{2|}}}}}}}</includeonly>
<includeonly>{{#switch:{{lc:{{{1|}}}}}|no categories|no cat|nc = |#default = {{#ifeq:{{NAMESPACE}}||{{{2|}}}}}}}</includeonly><!--
 
--><noinclude>
 
'''this documentation was generated by chatgpt's interpretation of the template code. Trust at your own responsibility.'''
 
== Template: Categorize ==
The "Categorize" template allows you to conditionally hide or suppress the output based on the value of the first parameter and the current namespace.
 
=== Usage ===
<nowiki>{{Categorize|parameter|fallback}}</nowiki>
 
- '''parameter''': The value you want to evaluate. If it matches specific cases, the output will be suppressed.
- '''fallback''' (optional): The fallback value to display if the first parameter doesn't match any cases or is not provided.
 
=== Cases ===
- If the first parameter matches "no categories," "no cat," or "nc," the output will be suppressed.
- If the first parameter doesn't match any cases or is not provided, the output will depend on whether the template is used within a namespace or outside of any namespace, and it will be controlled by the fallback value.
 
=== Example ===
<nowiki>{{Categorize|no categories|This template is used outside a namespace.}}</nowiki>
 
If used in the main namespace, the output will be suppressed. If used in any other namespace, the output will be "This template is used outside a namespace."
 
For any other parameter values, the output will follow the same behavior based on the specified cases and fallback.
 
Please note: This template should be used for conditional output control when dealing with categories or namespace-related conditions.
 
</noinclude>

Revision as of 11:45, 30 July 2023


this documentation was generated by chatgpt's interpretation of the template code. Trust at your own responsibility.

Template: Categorize

The "Categorize" template allows you to conditionally hide or suppress the output based on the value of the first parameter and the current namespace.

Usage

{{Categorize|parameter|fallback}}

- parameter: The value you want to evaluate. If it matches specific cases, the output will be suppressed. - fallback (optional): The fallback value to display if the first parameter doesn't match any cases or is not provided.

Cases

- If the first parameter matches "no categories," "no cat," or "nc," the output will be suppressed. - If the first parameter doesn't match any cases or is not provided, the output will depend on whether the template is used within a namespace or outside of any namespace, and it will be controlled by the fallback value.

Example

{{Categorize|no categories|This template is used outside a namespace.}}

If used in the main namespace, the output will be suppressed. If used in any other namespace, the output will be "This template is used outside a namespace."

For any other parameter values, the output will follow the same behavior based on the specified cases and fallback.

Please note: This template should be used for conditional output control when dealing with categories or namespace-related conditions.