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

The Editor editor at fast.st
Sun Feb 4 18:15:39 CST 2007


Pm, I am stuck again...

I added a custom resolvepagename function that converts /'s to the - .
notation PmWiki likes.  Works great.

I added a custom pageurl definition that converts the - . notation
into /'s so when you hover over the links they look like we want and
go where we want.  So far so good.

However, two problems that have me stumped...

1)  I added a line in the pageurl function like this, to be able to
assign my own home pages when one didn't exist.  It works mostly like
it should...

	if ($group == $name) $name = "Home";

The problem is PmWiki seems to think the page doesn't exist even when
it does, so in deciding on which link format to use
($LinkPageExistsFmt vs $LinkPageCreateFmt) it must not be using the
$PageUrl variable. I could disable the create fmt but that's a half
hearted solution.

2)  I would like to also change the display from - . to / but can't
seem to figure out how to do it.

It seems this question is related to LinkUrl or LinkText but these are
not called like the other page variables, but rather inside the
LinkIMap function with various parameters passed to them.  Does this
mean there's no way to redefine these?  Where is it the link is
checked to see if it exists?  Could that be reset somehow?

On another note...

I tried creating variable called hgLinkPrefix which could be set in a
config file to automatically prepend links with some base level.  That
is, if on a page in Test-Main-One.Home and the linkprefix was set to
Test-Main, then a link like Two.Garage could be automatically point to
Test-Main-Two.Garage (designed to keep newbies in subdirectories).  I
had it also designed so a person could begin the links with "." if you
wanted to ignore the linkprefix and it kind of works.

However...

I am having problems getting this to work properly with the relative
and absolute urls I've set up.... Basically, my markup is:

Markup('[[hg','<var','/\\[\\[([\\*|\\^|\\.]+)(.*?)\\]\\]/e',
'hgLinks("$1","$2")');

Now given the link [[.***.Test]]

I want it to pick up the leading . as an $1 (= to . or '' if not
there), The *** as $2, and the remainder as $3.  Can someone help me
rewrite this tricky little thing?

Cheers,
Dan



More information about the pmwiki-users mailing list