[pmwiki-users] Comments #2 revisted

Hans design5 at softflow.co.uk
Mon Dec 4 05:36:30 CST 2006


Monday, December 4, 2006, 11:15:15 AM, Mark wrote:

> So can I make a small link next to the edit and view links on a content page
> that takes to discussion page for that content page only. Can I also, update
> the comment page with a box stating that a discussion/comments about this
> content page are underway and thus you need to visit the discussion/comments
> page

Go to Site.PageActions (you are using pmwiki default skin) and edit
this page and add a new link:

*[[{FullName}-Discussion| Discuss]]

which creates a link to page PageName-Discussion, a new page for
discussing PageName.

To tie PageName-Discussion to PageName, two possibilities are:
a) create a link back.
b) include PageName at the top of the discussion page.

For a)
add to config.php:

    $BaseNamePatterns['/-Discussion$/'] = '';

Then you can use as a link from PageName-discussion to PageName:

Back to [[{$BaseName}]]

{$BaseName} is a page variable which strips the -Discussion part off
the page name, i.e. any part defined in $BaseNamePatterns.

For b)
add to config.php:

    $BaseNamePatterns['/-Discussion$/'] = '';
    
add to discussion page

    (:include {$BaseName}:)

Lastly, you could make the link to the discussion page more
intelligent, by writing it on Site.PageActions like this:

(:if exist {$FullName}-Discussion:)
*[[{$FullName}-Discussion| Discuss]]
(:if !exist {$FullName}-Discussion:)
*[[{$FullName}-Discussion| Create Discussion]](:if:)

but you still may have to content with  aquestion mark beside the link
to a non-existent page.

Note that if you eventually upgrade to pmwiki 2.2.0 you would need to
change all occurences of {$FullName} into {*$FullName}



Hans





More information about the pmwiki-users mailing list