Skip to content

Template: Wiki Article

Kevin Zhang edited this page Aug 5, 2019 · 3 revisions

Wiki Article Template

This template determines how an article is displayed within the Wiki Page wrapper template as outlined below:

wiki_article_highlight

In addition to the variables in the Wiki Page template, the Article template has:

Single Variables

article

{article}

This variable displays the fully rendered article's text.

author

{author}

Displays the screen name of the member who wrote the current version of article.

revision_date

{revision_date format=""}

When a revision of an article is displayed this shows the date of the revision being viewed.

The format parameter is used to determine the date's formatting using ExpressionEngine's [Date Variable Formatting] (</templates/date_variable_formatting). For example, this:

Revised: {revision_date format="%D, %F %d, %Y - %g:%i:%s"}

Would render this:

Revised: Mon, January 15, 2006 - 10:23:45

##Conditional Variables

There is only one conditional variable available to the Wiki Article template.

if categories

{if categories}

Checks to see if the currently displayed article has been assigned to any categories. If it is, the Special Category Tags <#special>_ can be used to display the categories on the article page.

Special Category Tags

If an article is assigned to one or more categories you can use the {wiki:categories} tag to display the categories beneath the article as outlined below:

wiki_article_cats

If an article has categories you can display them beneath the article.

Special Category Namespace

In the "Category" Namespace you also have the ability to create a list of articles that are assigned to a specific category as outlined below:

wiki_single_cat

Displays all the articles in a category.

Note:: A Namespace is a way to organize content by a special keyword (the "namespace") that is not a title, topic, or category name. For example, the wiki currently uses, by default, namespaces called Special, File, and Category to organize wiki content.

Namespace features will be expanded on in future versions. In the current verison you can use the Category Namespace in the Article Template to create a list of articles that are assigned to a specific category.

This is done by using the special {if namespace == 'Category'} conditional and a combination of the wiki_category_subcategories and wiki_category_articles tags described in the Special Categories section of the Wiki documentation.