[pmwiki-users] PageName without Group in the URL and other URL generating issues
Patrick R. Michaud
pmichaud at pobox.com
Thu Aug 18 21:33:33 CDT 2005
On Thu, Aug 18, 2005 at 04:43:51PM -0400, Waylan Limberg wrote:
> I recently started playing with PMWiki and have managed to figure out
> quite a few little hacks so that URLs are the way I want them rather
> than default behaviour. However, there are a few problems I haven't
> solved. I don't care for the way that PMWiki generates URLs to pages.
> Let me expound.
>
> As I currently understand it, a page must always be called by
> Group/PageName. So if you have a page for each of your products they
> would be (assuming pmwiki.php is in the server root):
> http://example.com/products/widget
> http://example.com/products/gizmo
>
> That behavior is fine (mostly - see last gripe). What about the main
> products page where all the products are listed? Currently we could do
> something like the following:
> http://example.com/products/all
>
> While that works, I would prefer:
> http://example.com/products
No problem. Whenever PmWiki gets a pagename like "Products" that has
only one component (i.e., no dot or slash), it tries the following
pages:
"Products/Products"
"Products/HomePage" (as set by $DefaultName)
"Main/Products"
So, if you wanted "/products" to go to "Products/All" then you can
do any of:
1) $DefaultName = "All";
2) if ($pagename == "products") $pagename="Products.All";
3) Create Products.Products with (:redirect All:) as its contents
> Additionally, if there is a single page, like, say, the 'About' page, doesn't
> http://example.com/about
> make more sense than:
> http://example.com/site/about
Sure, but this already works (sorta). Try it:
http://www.pmwiki.org/wiki/WikiSandbox takes you directly to Main.WikiSandbox.
(Currently it updates the url with the new location, but we could probably
provide an option to eliminate this step.)
> Oh, and one other thing. As you may have noted, none of the above
> example have any capital letters (except where the Group and PageName
> variable are used). I generally insist that all URLs be all lowercase
> only. Is there a way to disable the first character of each Group and
> PageName from being capitalized in the URLs.
I think it's doable but it will take a fair bit of work. The first
step is to probably process the $pagename variable in config.php
before the rest of PmWiki gets to it. Also, the links are all
generated by FmtPageName(), so there ought to be a way we can hook
in a "convert page links to lowercased urls" feature there somewhere.
Pm
More information about the pmwiki-users
mailing list