[pmwiki-users] Markup to extract a substring for a Group Name

Tegan Dowling tmdowling at gmail.com
Thu Oct 25 17:55:50 CDT 2007


On 10/25/07, Ben Stallings <ben at interdependentweb.com> wrote:
> Randy wrote:
> > I'm using PmWiki 2.1. I keep my content and talk pages separated by
> > group, using the same page name. The group name simply has the suffix
> > "Talk". For example MyGroup.MyPage and MyGroupTalk.MyPage.
> >
> > I want to put a link on the Sidebar, so that when I'm on any Talk
> > page the user can go to its content page. (The other direction is
> > easy: {$Group)Talk.{$Name}.) How do I extract the current group name
> > minus the "Talk" suffix, so I can do {$GroupBaseName).{$Name}?
>
> First, upgrade to 2.1.27 or later.  Then use
>
> {(substr {$Group} 0 -4)}.{$Name}

(Actually, I run 2.1.26 and this works for me when I install
MarkupExpressions --
http://www.pmwiki.org/wiki/Cookbook/MarkupExpressions)



More information about the pmwiki-users mailing list