Retired Documentation
You are using the documentation for version 2.11.9. Go here for the latest version or check here for your available upgrades to the latest version.
Wiki Page Section¶
This is the wrapper section that contains the header, sidebar, navigation, CSS, and the elements found in a standard HTML page including the CSS. It “wraps” around all the user editable content as outlined in the screencap below.
The variables available to the Wiki Page section are divided into the following broad categories:
Single Variables¶
original_page¶
{original_page}
If a page is redirected, this tag displays the name of the original page. This variable is used inside the if redirected conditional.
redirect_page¶
{redirect_page}
If a page redirects this variable sets the page to which it redirects. The value is set dynamically by ExpressionEngine. This variable is used inside the if redirected conditional.
revision_id¶
{revision_id}
If you are viewing a revision of an article, this variable displays the the revision id for that revision.
title¶
{title}
Displays the Title/Name of the article page. This variable also works with Special and File template sections too).
csrf_token¶
{csrf_token}
This variable is a required value for hidden form field ‘csrf_token’.
Note
This variable was previously called as {XID_HASH}
and used
in a field named ‘XID’.
Namespace Variables¶
main_namespace¶
{main_namespace}
The name of the ‘Main’ default namespace, which is where all articles without a namespace in their title are put.
Path Variables¶
path:wiki_base_url¶
{path:wiki_base_url}
This variable will generate the base URL for the wiki, with a trailing slash. This is useful for linking to special pages like Categories, Title list, etc… For example, this:
<a href="{path:wiki_base_url}{special_namespace}:Titles">Title List</a>
Would be rendered like this:
<a href="http://example.com/index.php/wiki/Special:Titles">Title List</a>
path:wiki_home¶
{path:wiki_home}
This variable will generate the URL for the wiki’s homepage which is set in the Wiki Control Panel. For example, this:
<a href="{path:wiki_home}">Home</a>
Would be rendered like this:
<a href="http://example.com/index.php/wiki">Home</a>
path:view_article¶
{path:view_article}
When viewing an article page this variable displays the URL to view the article. Think of it as the article’s “permalink”.
path:edit_topic¶
{path:edit_topic}
When viewing an article page this variable displays the URL to edit the article.
path:article_history¶
{path:topic_history}
When viewing an article page this variable displays the URL to an article’s history.
Member Variables¶
path:your_control_panel¶
{path:your_control_panel}
Displays the URL to the Your Control Page of the logged in user.
path:logout¶
{path:logout}
Displays the URL to the logout script.
Note to Discussion Forum Module users: The Wiki Tag has an optional parameter called profile_path=’‘. When this parameter is used, you can direct the member paths from the default member area of your ExpressionEngine installation to the Discussion Forum member area.
Conditional Variables¶
The best way to understand how these conditionals are used is to look at the code in the themes/wiki_themes/default/default.php file. Do a search for the conditional you are reviewing and see how it is used in the template.
if redirected¶
{if redirected}
Checks to see if the current page has been redirected from another page.
if article_history¶
{if article_history}
Checks to see if the current page is the article’s History page.
if special_page¶
{if special_page}
Checks to see if the current page is a Special page (Categories, Title list, etc…) in the wiki.
if file_page¶
{if file_page}
Checks to see if the current page is the special File page in the wiki.
if can_edit¶
{if can_edit}
Checks to see if the current visitor to the page is logged in and has permission to edit the article.
if cannot_edit¶
{if cannot_edit}
Checks to see if the current visitor to the page is logged in and does not have permission to edit the article.
{wiki:categories_list}¶
This tag is used to display all the wiki’s categories. Unlike the {wiki:categories} tag, it is not affected by being put in an article page. It has the following parameters and variables available to it.
{wiki:categories_list} | Parameters¶
backspace=”“¶
{wiki:categories backspace="#"}
This removes “#” number of characters (including spaces and line breaks) from the output at the end of the loop. This is useful for removing commas and <br />’s.
show_empty=”“¶
{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:
- no: Categories with no articles will not be displayed.
style=”“¶
{wiki:categories style=""}
This will automatically nest the categories for you as standard xhtml using <ul> or render a list without any formatting. The values are:
- nested: renders the categories in a xhtml list with <ul>.
- linear: renders the categories with no formatting.
For more information on nesting please see the Style parameter in the Channel section of the User Guide.