x
 
Create New Page

Revision: Wiki Talk or Discussion Pages

Revision from: 11:29, 18 Apr 2008

Question:

How do I add a “Talk” or “Discussion” namespace to my wiki like the ExpressionEngine Wiki?

Answer:

First, create the new namespace for your talk / discussion pages per the instructions in the User Guide.  This example uses “Talk”.

Next, open your Wiki theme, and in the Article menu section (where the Special Page, File Page, View, Edit, and History links are), change:

<a href="{path:view_article}">View</a>

to:

{if namespace == "Talk"}<a href="{path:wiki_home}{topic}/">Article</a>
{if:else}<a href="{path:view_article}">Article</a>{/if}

{if namespace
== "Talk"} - <a href="{path:view_article}">Talk</a>
{if:else} - <a href="{path:wiki_home}Talk:{title}/">Talk</a>{/if}

Here’s how it works.  We want “Article” and “Talk” to appear on every page, and we want each to always link to the right place.  Article should always go to a link of simple “Article_Title”, and Talk should always go to “Talk:Article_Title”.  We don’t, for instance, want a link to go to anything like “Talk:Talk:Article_Title”, which would happen if we just used “Talk:{title}” for the Talk link.  On Talk pages, this would include the “Talk” namespace in the link again, and so on, and so on.

So if we are on the page “Talk:Article_Name”, the Article link will just use {topic}, which never includes the namespace.  If we’re on the page “Article_Name”, the {path:view_article} variable is sufficient for the Article link.

For the Talk links, if we are on the page “Talk:Article_Name”, the Talk link will use {path:view_article}, which does include the namespace, and points to itself.  If we’re on the page “Article_Name”, the Talk link adds “Talk:” plus the {title} to your Wiki’s home path.

Category:Wiki -> Wiki Customization
Category:Wiki -> Wiki Namespace