[pmwiki-users] Compute $EditRedirectFmt?
Patrick R. Michaud
pmichaud at pobox.com
Thu Nov 9 15:11:22 CST 2006
On Thu, Nov 09, 2006 at 08:49:12PM +0000, Lucian Wischik wrote:
> I'm trying to use $EditRedirectFmt. The documentation
> http://www.pmwiki.org/wiki/PmWiki/EditVariables#EditRedirectFmt
> suggests examples like
> $EditRedirectFmt = '{$Group}.HomePage';
>
> But I want $EditRedirectFmt to be computed through a regexp on
> the $FullName. For example, if the user was editing a page
> "Main/TopicComments" then I want to redirect to "Main/Topic".
> (i.e. stripping "Comments" off the end).
In 2.2.0-beta, you might be able to do:
# cause {$BaseName} to strip "Comments" off the end of pagenames
$BaseNamePatterns['/Comments$/'] = '';
# set $EditRedirectFmt to redirect to the basename.
$EditRedirectFmt = '{$BaseName}';
Pm
More information about the pmwiki-users
mailing list