-
Notifications
You must be signed in to change notification settings - Fork 5
Template: Wiki Special Categories
The Special Categories template creates a list of all the categories in a site as outlined below:
Displays all the categories in the wiki.
In addition to the variables in the Wiki Page template, the Special Categories template makes use of the the following Tags:
This tag is used to display all the wiki's categories. When put into the Wiki Article template, it will only show the categories for that specific article. It has Parameters and [Variables](#wiki_categories_variables available to it.
{wiki:categories backspace="#"}
This removes "#" number of characters from the output at the end of the
loop. This is useful for removing commas and
's.
{wiki:categories show_empty="no"
This parameter lets you tell the wiki whether or not to display categories with no articles assigned to it. The possible values are:
Note: Categories with no articles will not be displayed.
{wiki:categories style=""}
This will automatically nest the categories for you as standard xhtml using
- or render a list without any formatting. The values are:
-
nested: renders the categories in a xhtml list with
- .
- linear: renders the categories with no formatting.
For more information on nesting please see the [Style parameter] <channel_categories_style>` in the Channel section of the User Guide.
{path:view_category}
Creates a link to view a specific category page.
Displays the category name.
{count}
"count" of the category currently being displayed in the list
{depth}
Determines how many nested layers down a category is.
{switch="option_one|option_two|option_three"}
This variable permits you to rotate through any number of values as the categories are displayed. The first category will use "option_one", the second will use "option_two", the third "option_three", the fourth "option_one", and so on.
Multiple instances of the {switch=} tag may be used and the system will intelligently keep track of each one.
{if depth == '#'}
You can check to see if a category is at a certain "depth" in the list.
{if children}
Determines if a category has one or more "children" categories.
{if first_child}
Determines if a category is the first child of a parent category.
{if last_child}
Determines if a category is the last child of a parent category.
This tag is used to display the subcategories of a single category. It
has :ref:Parameters <wiki_category_subcategories_parameters>
and
:ref:Variables <wiki_category_subcategories_variables>
available to it.
{wiki:category_subcategories backspace="#"}
This removes "#" number of characters from the output at the end of the
loop. This is useful for removing commas and
's.
{wiki:category_subcategories style=""}
This will automatically nest the subcategories for you as standard xhtml using
- or render a list without any formatting. The values are:
-
nested: renders the categories in a xhtml list with
- .
- linear: renders the categories with no formatting.
For more information on nesting please see the :ref:Style parameter <channel_categories_style>
in the Channel section of the User Guide.
{header} content before listing subcategories. {/header}
This variable will display content before the subcategories are listed.
{footer} content after listing subcategories. {/footer}
This variable will display content after the subcategories are listed.
{if subcategory_total == '0'}
Test the number of subcategories. This is typically used display alternate content if no subcategories exist.
{path:view_category}
This creates a link to view a category's page (a list of all the titles in that category).
{category_name}
Displays a category's name.
{subcategory_total}
Displays the number of subcategories in a category.
This tag displays a list of articles within a category. It has
Parameters <#cat_art_para>
_ and Variables <#cat_art_var>
_ available
to it.
{wiki:category_articles backspace="#"}
This removes "#" number of characters from the output at the end of the
loop. This is useful for removing commas and
's.
{wiki:category_articles limit=""}
This determines how many articles are displayed on a category's page. For example, this::
{wiki:category_articles limit="20"}
Would limit the number of articles displayed to 20.
{wiki:category_articles paginate=""}
The Wiki module uses the same pagination syntax as all first-party
modules. Please look at the :doc:/templates/pagination
documentation
for more information.
Pair Variables <#catart_pair>
_
Conditional Variables <#catart_con>
_
Single Variables <#catart_sin>
_
{header} content before listing articles. {/header}
This variable will display content before the articles are listed.
{footer} content after listing articles. {/footer}
This variable will display content after the articles are listed.
{letter_header}<div class="cap">{letter}</div>{/letter_header}
This is used to organize articles by the first letter of the title. It looks at the first character of each article and when there is a new character it will create a header for that letter using the {letter} variable as in the example above.
{if articles_total == '0'}
Test the number of articles. This is typically used to display alternate content if no articles exist for a particular category.
{path:view_category}
This creates a link to view a category's page (a list of all the titles in that category).
{category_name}
Displays a category's name.
{articles_total}
Displays the number of articles in a category.