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

Ben Stallings ben at interdependentweb.com
Thu Oct 25 17:43:34 CDT 2007


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}

--Ben S.



More information about the pmwiki-users mailing list