TalkPages

Summary: Talk pages, as enabled on pmwiki.org
Version:
Prerequisites:
Status: Stable
Maintainer: Petko
License: Public domain
Users: (view? / edit)
Discussion: TalkPages-Talk

Questions answered by this recipe

How are talk pages enabled on PmWiki.org?

Description

Talk pages, as enabled on pmwiki.org.

On PmWiki.org, both in the core documentation and in the sections Cookbook and Skins, we have created Talk pages. On a talk page, we move content from the main page that is unverified, and any discussions that help improve and clarify the main page.

To enable talk pages, we use a few core features, notably PageVariables, GroupHeaders and GroupFooters and ConditionalMarkup. In addition, we use EditTemplates to pre-fill the content of newly created pages with the required PageVariables in the infobox.

In config.php, we need to define a pattern to create a "base name" page from an existing page, either main or talk page. Add this to config.php:

$BaseNamePatterns['/(-Talk|-Users)$/i'] = '';

With this code, if a page name ends with "-Talk" or with "-Users", for example "BasicEditing-Talk", its base page will be the first part of the name with the suffix "-Talk" or "-Users" removed. This is used in the definition of the {*$BaseName} page variable. If a page doesn't have a suffix, it is considered a base page.

The following markup (simplified here for clarity) is placed in the page YourGroup.GroupFooter:

>>frame<<
(:if name *-Talk:)
Talk page for improving [[{*$BaseName}|+]].
(:else:)
This page may have [[{*$BaseName}-Talk|a talk page]].
(:ifend:)
>><<

This page may have a talk page.

The block, placed in a GroupFooter, will appear at the bottom of all pages of YourGroup. If a page is named *-Talk, it will link to the main page (without the "-Talk" part). Otherwise, it will link to a page that has a "-Talk" suffix.

Alternatively, you can place such a conditional in a PageActions page, or in a SideBar page:

(:if name *-Talk:)
* [[{*$BaseName}|Page]]
(:else:)
* [[{*$BaseName}-Talk|Talk]]
(:ifend:)

In a wiki-page, you can use the same links with the {*$BaseName} or {*$Name} variables, or you can type the full page names:

* [[{*$BaseName}-Talk]]
* [[{*$FullName}-Talk]]
* [[{*$Group}/{*$Name}-Talk]]
* [[TalkPages-Talk]]

Notes

Change log / Release notes

This Talk page format was generalized on PmWiki.org in 2009 when the documentation was reviewed and updated.

See also

Contributors

  • Originally configured on PmWiki.org by Petko.
  • Recipe written and maintained by Petko.

Comments

See discussion at TalkPages-Talk