[pmwiki-devel] New beta Hg with clean urls...

The Editor editor at fast.st
Sun Feb 4 19:26:32 CST 2007


From the Hg page...  It's still a bit buggy, but it's pretty neat
too... I'm hoping some of you can help me to clean it up...

Cheers,
Dan



New BETA release...

I've been doing a lot of tinkering with Hg to get it to accommodate a
look like cleanurls, and have a beta upgrade available if others wish
to help debug. Hg1.1.phpΔ.

This allows you to type in a url like:

http://.../index.php?n=Kingdom/Animal/Canine/Dog

and it will automatically load Kingdom-Animal-Canine.Dog The last part
is always the page name, with or without a trailing slash. You should
be able to get rid of index.php?n= by url rewriting.

Also, if you enter a link like [[Kingdom-Animal-Canine.Dog|My Pet]]
and you click it, n=Kingdom/Animal/Canine/Dog will appear in your
browser! At some point I'll make this feature optional, but it's not
so in the beta as I'm still testing...

I also added an optional $hglinkprefix you can use to keep users in
some subgroup by automatically prefixing their links with some value.
Very useful! Can be overwritten by beginning your link with a ".".

Ex: If on page [[Main-Test-One.Hi]] and you set this value to
"Main-Test" then links like [[Two.Bye]] will automatically be
converted to Main-Test-Two.Bye. Whereas [[.Two.Bye]] will become
Two.Bye. Also if a . is prefixed, and there is no hglinkprefix set,
the dot is ignored--which is useful for things like sidebars,
pagelists, or included pages.
Finally, I set up a system for setting default home pages for groups,
by resetting the link value when the group and name are identical to
group.Home (configurable with $hghomepage). Of course it causes a bit
of a problem when you want Test.Test, but it does come in hand when
you want to go to the home page in some long chain group that doesn't
exist and you want to just type [[{$Group}.]].

Let me know what you think, or if you spot any problems. These changes
were a bit over my head, but it seems to be working like I wanted.
Several of the test pages at the Hg site include sample, practice
links... Look around and feel free to create your own pages and
test...

Still a New BETA release...

I've been doing a lot of tinkering with Hg to get it to accommodate a
look like cleanurls, and have a beta upgrade available if others wish
to help debug. Hg1.1.phpΔ.

This allows you to type in a url like:

http://.../index.php?n=Kingdom/Animal/Canine/Dog

and it will automatically load Kingdom-Animal-Canine.Dog The last part
is always the page name, with or without a trailing slash. You should
be able to get rid of index.php?n= by url rewriting.

Also, if you enter a link like [[Kingdom-Animal-Canine.Dog|My Pet]]
and you click it, n=Kingdom/Animal/Canine/Dog will appear in your
browser! At some point I'll make this feature optional, but it's not
so in the beta as I'm still testing...

I also added an optional $hglinkprefix you can use to keep users in
some subgroup by automatically prefixing their links with some value.
Very useful! Can be overwritten by beginning your link with a ".".

Ex: If on page [[Main-Test-One.Hi]] and you set this value to
"Main-Test" then links like [[Two.Bye]] will automatically be
converted to Main-Test-Two.Bye. Whereas [[.Two.Bye]] will become
Two.Bye. Also if a . is prefixed, and there is no hglinkprefix set,
the dot is ignored--which is useful for things like sidebars,
pagelists, or included pages.
Finally, I set up a system for setting default home pages for groups,
by resetting the link value when the group and name are identical to
group.Home (configurable with $hghomepage). Of course it causes a bit
of a problem when you want Test.Test, but it does come in hand when
you want to go to the home page in some long chain group that doesn't
exist and you want to just type [[{$Group}.]].

Let me know what you think, or if you spot any problems. These changes
were a bit over my head, but it seems to be working like I wanted.
Several of the test pages at the Hg site include sample, practice
links... Look around and feel free to create your own pages and
test...


More information about the pmwiki-devel mailing list