[pmwiki-users] New Hierarchical Groups Recipe...

The Editor editor at fast.st
Fri Feb 2 12:09:09 CST 2007


On 2/2/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Fri, Feb 02, 2007 at 11:00:10AM -0500, The Editor wrote:
> > >> I am sure PmWiki could be made to convert a url to Group-Group.Name
> > >> from whatever syntax was chosen, though that might require a core
> > >> change or two (how does cleanurls do it?).
> > >
> > >It doesn't require a core change at all.  Simply write a function
> > >that does the equivalent of what ResolvePageName() does now,
> > >which is to take whatever is given in the url and convert it into
> > >a PmWiki-standard pagename.
> >
> > Easy enough...  I could do that...  Is that what cleanurls does?
> >
> > How do you get your custom function called instead of ResolvePageName?
> > That is if someone typed in index.php?n=Animal.Canine.Dog, how do I
> > get it to use my function and not the default one?
>
> You don't have to take out the default one (ResolvePageName) --
> if the pagename is already a PmWiki-standard pagename, then
> ResolvePageName leaves it alone.

Sorry to be dense, but if I type index.php?n=Animal/Canine/Dog into my
browser, do I just put something like $pagename =
MySpecialResolveFunction($n) into Hg to get PmWiki to load
Animal-Canine.Dog?

> > >The problem with using a closing / or . at the end to indicate the
> > >group is that many people won't see them there, or recognize that
> > >they're a required part of the url.
> >
> > Yes that crossed my mind too.  Do you have a suggestion?  I suppose if
> > we just require them to manually enter Homepage, and get [[Group.]] to
> > go to Homepage, that would solve the problem, wouldn't it?
>
> While it's one approach, I don't think it "solves the problem", since
> the end result is to shift the work away from the computer and
> onto people (and add some surprises/frustration in the process).
> But that's just my opinion, specific sites might see this as
> being an acceptable approach.

What exactly is the problem?  I thought it was related to pages not
being both groups and pages simultaneously.  It would largely solve
that...  Specifying a Homepage is not that much extra work.  And I'm
not sure where the surprise might be.  It seems like it would work...

On 2/2/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Fri, Feb 02, 2007 at 10:54:25AM -0600, Patrick R. Michaud wrote:
> > On Fri, Feb 02, 2007 at 11:00:10AM -0500, The Editor wrote:
> > > >> I am sure PmWiki could be made to convert a url to Group-Group.Name
> > > >> from whatever syntax was chosen, though that might require a core
> > > >> change or two (how does cleanurls do it?).
> > > >
> > > >It doesn't require a core change at all.  Simply write a function
> > > >that does the equivalent of what ResolvePageName() does now...
>
> Oh, and we'd also have to adjust the code for {$PageUrl} so that
> it converts hyphens-to-slashes when generating page urls.  But
> that one isn't nearly as difficult (and probably not worth worrying
> about until the other issues are decided first).

What is this variable used for--creating links? It can be defined
according to a custom function I suppose?

And what issues specifically still should to be decided? It would be
nice to get up at least one good option...

Sorry for begin so persistent.  Somehow I feel we are just on the
brink of fuller solution.  I'd like to get there while the code is all
fresh in my mind.

Cheers,
Dan



More information about the pmwiki-users mailing list