[pmwiki-users] New Hierarchical Groups Recipe...
editor at fast.st
Sun Feb 4 06:30:46 CST 2007
Very helpful Pm! Appreciate very much the long email... It did not
seem to work exactly as you explained, but I did come up with a
workaround. Below are a few comments... I cut out several sections
of your explanation, if the below seems choppy...
On 2/4/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> The entries in the $FmtPV array have to be expressions that
> describe how to go from a given pagename (providied by the
> $pn, $group, and $name local variables in PageVar) to the
> desired value. For example, here's the $FmtPV definition for $Name:
This was what I was looking for. Makes sense now.
> So, if you want to redefine $PageUrl such that any hyphens in
> the group portion of the name are converted to slashes, you
> could start with:
> $FmtPV['$PageUrl'] =
> '$ScriptUrl . "/" . str_replace("-", "/", $group) . "/" . $name';
I actually had my own function I wanted to use because I have a couple
extra really useful features thrown in. Namely, that you can define a
base starting point for links subgroups, to make it easy for users to
create links far down the chain. Nice! Also that you can make the
slashes optional for some seem to prefer the clear group.page
> Now then, the above works as long as the webserver understands
> PATH_INFO style links (e.g., if $EnablePathInfo = 1, producing
> .../wiki/Group/Name). Unfortunately, many sites can't use this
> style, so our definition of $PageUrl needs to be able to
> produce the ?n=Group.Page style of links when
> account as well
I seem to have gotten around this, because while my home system failed
the EnaglePathInfo test, the custom ResolvePageName function I'm using
seems to get around the problem. Which is nice because I never could
get cleanurls to work. But now my links are all working with just
$FmtPV['$PageUrl'] = 'PUE("$ScriptUrl?n=" . hgUrl("$pn"))';
I was hoping to use url rewriting to eliminate even need for index.php
and ?n= so I'm not worrying about that at this time.
I should be able to upload the revised recipe later today. When I do,
Pm, please take a look over it to see if it looks ok. Pretty
exciting... Thanks again so much for your patient explanations.
Extremely help as always!
More information about the pmwiki-users