Template:Template other

From FlightGear wiki
Jump to navigation Jump to search


The following template description is not displayed when the template is inserted in an article.

Goal

This template can be used to show a different text if it is not used on a page in the template namespace. It can also be used for category suppression, to avoid that a page is categorized if it is not in the template namespace

If more than one namespace need to be handled, use {{namespace detect}}.

Usage

{{template other|text if template|text if other |demospace=}}
text if template
Optional text to use if the template is on a page in the template namespace.
text if other
Optional text to use if the template is on a page in any other namespace.
demospace
Optional namespace override. If it is empty or undefined the namespace of the page with the template on will be used, if it is template then text if template will be shown and if it is other or any other namespace then text if other will be used.

Examples

Text selection

Since this is a template page {{template other|this text will be shown|this text will not be shown}}.

Since this is a template page this text will be shown.

However with {{template other|a little bit of|some cheating|demospace=other}}...

However with some cheating...

Category suppression

Using the template like this will only categorize a page when it is in the template namespace:

{{template other|[[Category:Namespace templates]]}}

Related templates