Clean Hierachical URL's
Re: Clean Hierachical URL's
One thing I would like to mention, is that 'link' content types need their GetURL() method to be called, rather than the makeHierURL(). I added a test to the top of makeHierURL for that. Do you think that there are other content types that will also need to use their own GetURL implementation, rather than makeHierURL?
I'm wondering if there's a way to do this globally, i.e. create a global boolean setting that indicates a) using hierarchical URLs, or b) using "?page=xyz" URLs. Then in ContentBase::GetURL, check that setting, and return one or the other - and subclasses like link (lib/contenttypes/Link.inc.php) would override GetURL, which is what they currently do. No need to modify subclasses for content types that have their own special URL formats or needs - does this make sense?
Cheers,
-sloop
I'm wondering if there's a way to do this globally, i.e. create a global boolean setting that indicates a) using hierarchical URLs, or b) using "?page=xyz" URLs. Then in ContentBase::GetURL, check that setting, and return one or the other - and subclasses like link (lib/contenttypes/Link.inc.php) would override GetURL, which is what they currently do. No need to modify subclasses for content types that have their own special URL formats or needs - does this make sense?
Cheers,
-sloop
Re: Clean Hierachical URL's
Take a look at what I did in svn. I have GetURL calling makeHierarchyURL when it needs it. Then Link's override still works without any change.
I added some extra parameters to config.php to turn this on and off. It seems pretty clean to me. Let me know what you think.
I added some extra parameters to config.php to turn this on and off. It seems pretty clean to me. Let me know what you think.
Re: Clean Hierachical URL's
This is great news Ted, especially the relative paths working in FCK.
I'm assuming it won't break anyt pre-existing setups that use mod_rewrite but, rather, will allow a simple transition for those wanting it?
Incidentally, I think the URLs would look pretiier if the index.php were removed.
I'm assuming it won't break anyt pre-existing setups that use mod_rewrite but, rather, will allow a simple transition for those wanting it?
Incidentally, I think the URLs would look pretiier if the index.php were removed.
Re: Clean Hierachical URL's
Nope, it shouldn't touch existing setups. I have the new settings set to false on upgrade from an older version, so you won't notice any difference unless you go hunting for it.
index.php will be removed if you setup mod_rewrite. The index.php urls are the out-of-the-box work on most setups solution. Adding the one rewrite rule and changing a parameter in config.php will make index.php disappear.
index.php will be removed if you setup mod_rewrite. The index.php urls are the out-of-the-box work on most setups solution. Adding the one rewrite rule and changing a parameter in config.php will make index.php disappear.
Re: Clean Hierachical URL's
Where is the nightly SVN download, I need to have a look at this it sounds great, I just need to see how it works in practice. Inspired indeed Ted 
.
Russ

.
Russ
Re: Clean Hierachical URL's
Thanks Ted, I have downloaded the latest SVN on my Mac and it seems to work
In my my 'config.php' I have set:
In my ,htacess I have...
I had to remove the 'RewriteBase /' for my local use although I use it on my server test site
There are a few other problems -
1. ImageGallery for example.
2. Internal links from FCKeditor still use 'index.php?page=' style links
3. PI Search.. still use 'index.php?page=' style links
4. My Google sitemap thingy still does not use /parent/child format. If there an easy way to pull back each page with it's parents?
(My root level pages don't pick up my CSS (../css/cssfile.css) for obvious reasons, but the children do. I don't use the CMS way of doing it - but I may have to
so I don't know if the CSS bit would work for normal users)
Hope this helps, thanks again for such good work.
Russ

Code: Select all
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.html';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
Code: Select all
RewriteEngine On
Options FollowSymLinks
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.+)\.html$ index.php?page=$1 [QSA]
There are a few other problems -
1. ImageGallery for example.
2. Internal links from FCKeditor still use 'index.php?page=' style links
3. PI Search.. still use 'index.php?page=' style links
4. My Google sitemap thingy still does not use /parent/child format. If there an easy way to pull back each page with it's parents?
(My root level pages don't pick up my CSS (../css/cssfile.css) for obvious reasons, but the children do. I don't use the CMS way of doing it - but I may have to

Hope this helps, thanks again for such good work.
Russ
Last edited by Russ on Tue Apr 18, 2006 4:23 pm, edited 1 time in total.
Re: Clean Hierachical URL's
Glad to see it's working. 
Addressing the issues...
1. I'll fix it before release
2. I'm going to change fck so that it drops {cms_selflink} tags
3. Out of my control...
4. Check out this post, about 4 posts down. http://forum.cmsmadesimple.org/index.ph ... .html You want to use the GetURL method from a content object for grabbing the url and it will autoatmically be formatted based on the settings in config.php
As for the css, the root is always going to be where index.php lives, because of the base tag. As long as you set your relative path to the css from there, you should be fine.
Thanks
Ted

Addressing the issues...
1. I'll fix it before release
2. I'm going to change fck so that it drops {cms_selflink} tags
3. Out of my control...
4. Check out this post, about 4 posts down. http://forum.cmsmadesimple.org/index.ph ... .html You want to use the GetURL method from a content object for grabbing the url and it will autoatmically be formatted based on the settings in config.php
As for the css, the root is always going to be where index.php lives, because of the base tag. As long as you set your relative path to the css from there, you should be fine.
Thanks
Ted
Re: Clean Hierachical URL's
Thanks for the information Ted.
1. Look forward to it
2. It seems a shame to lose this as it is quite a good feature, but I guess if we have to we can live without it
3. I guess we need a better search engine
4. I'll check out the post and have a look, thanks again. I think an altenrative version of the sitemap does use this so maybe that will still work, I'll check it out.
MODIFIED [
Any ideas on setting a relative path to the route for the CSS?
Actually of course I can just set a fixed path in my 'StyleSwitcher' php using
global $gCms;
$config = $gCms->config;
and then add $config['root_url'] before my path.
Sorry I was being dense - way too early in the morning for me
END MODIFIED]
Another quick question, I've been using alias for pages, but why now use metadata ? What exactly was metadata for? I thought alias was the bit used to create friendly urls'? Do I now just have to set a friendly title in metadata, alias, or both. Sorry about the bit of confusion. (Currently I have it set in both, I just ran a SQL script to update metadata with the values in alias.)
MODIFIED[ Actually on further testing it seems to use the page alias for the friendly url? So I'm not sure what the reference is to metadata]END MODIFIED
Is there release date for 0.13 or will it be 1?
Russ
1. Look forward to it
2. It seems a shame to lose this as it is quite a good feature, but I guess if we have to we can live without it

3. I guess we need a better search engine

4. I'll check out the post and have a look, thanks again. I think an altenrative version of the sitemap does use this so maybe that will still work, I'll check it out.
MODIFIED [
Any ideas on setting a relative path to the route for the CSS?
Actually of course I can just set a fixed path in my 'StyleSwitcher' php using
global $gCms;
$config = $gCms->config;
and then add $config['root_url'] before my path.
Sorry I was being dense - way too early in the morning for me

END MODIFIED]
Another quick question, I've been using alias for pages, but why now use metadata ? What exactly was metadata for? I thought alias was the bit used to create friendly urls'? Do I now just have to set a friendly title in metadata, alias, or both. Sorry about the bit of confusion. (Currently I have it set in both, I just ran a SQL script to update metadata with the values in alias.)
MODIFIED[ Actually on further testing it seems to use the page alias for the friendly url? So I'm not sure what the reference is to metadata]END MODIFIED
Is there release date for 0.13 or will it be 1?
Russ
Last edited by Russ on Wed Apr 19, 2006 10:35 am, edited 1 time in total.
Re: Clean Hierachical URL's - Works awesome!
Hey Ted, Russ, everyone else,
After lurking on this post for the last few days, I decided to get the latest build from svn and try and make the url's as pretty as could be (no file type - mysection/sub-section/last-sub-section)
Good news is everything works like a charm (for me at least).
See http://www.seventhvision.com.au/cms/ for examples.
My Settings
Config File (relevant bits)
.htaccess
It didn't work for me when 'RewriteBase /' wasn't commented out.
What I've tested?
Go to http://www.seventhvision.com.au/cms/nav ... e-keywords where you will see I've edited the page slighty:
I hope this all wasn't a fluke cause I'll be so stoked if Ted, Russ, Sloop and sorry anyone I've missed out has got us to this point of ultimate pretty urls.
Finally, what prompted me to post is that Ted, you mentioned:
More info would be appreciated as it appears everything works and nothing is broken.
Best Regards,
Ryan
After lurking on this post for the last few days, I decided to get the latest build from svn and try and make the url's as pretty as could be (no file type - mysection/sub-section/last-sub-section)
Good news is everything works like a charm (for me at least).
See http://www.seventhvision.com.au/cms/ for examples.
My Settings
Config File (relevant bits)
Code: Select all
$config['assume_mod_rewrite'] = true;
$config['internal_pretty_urls'] = false;
$config['page_extension'] = '';
$config['use_hierarchy'] = true;
Code: Select all
RewriteEngine On
Options FollowSymLinks
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
What I've tested?
Go to http://www.seventhvision.com.au/cms/nav ... e-keywords where you will see I've edited the page slighty:
- Added 7th Vision logo
- Linked heading 'My Link Title' to another page with 'Generate taglink?' checked
I hope this all wasn't a fluke cause I'll be so stoked if Ted, Russ, Sloop and sorry anyone I've missed out has got us to this point of ultimate pretty urls.
Finally, what prompted me to post is that Ted, you mentioned:
I'm presuming that if you did that, then I woulnd't get the pretty url's in the content? It works for me so I'm not sure why it has to be removed?I'm going to change fck so that it drops {cms_selflink} tags
More info would be appreciated as it appears everything works and nothing is broken.
Best Regards,
Ryan
Re: Clean Hierachical URL's
OK the (sitemap.php attached) for a Google site map seems to work on my local test site giving (shown for one link). It's from eleswhere on this site so I take no credit - but it works
Well I think it does, how do you test the validity of the file produced? (Which is the attachment produced_sitemap.txt)
This is a snippet.
Permission to jump up and down and shout "Yipeee!" in a paricularly loud and shouty way!
Russ
[attachment deleted by admin]

This is a snippet.
Code: Select all
<url>
<loc>http://localhost/cms/testmenu/submenu/subsubmenu.html</loc>
<lastmod>2006-04-19T11:23:10+01:00</lastmod>
<priority>0.2</priority>
</url>
Russ
[attachment deleted by admin]
Re: Clean Hierachical URL's
Sorry, drops was not the right word. I modified FCK last night to default to {cms_selflink} tags when inserting links. It's a lot cleaner now, that's for sure.
@Russ: the {metadata} tag is the bit of code that's inserting the tag into that makes the deep urls still resolve their relative paths to images, etc.
@Ryno: glad it's working for you. I'm hearing some positive feedback about these latest changes, and that just adds to it. In your particular situation, you'd probably want RewriteBase /cms/, but I don't think most people need it at all.
So, I only have a couple more things I want to do... most likely tonight. Then unless anyone objects, I'll be releasing 0.13beta1 before the end of the week.
@Russ: the {metadata} tag is the bit of code that's inserting the tag into that makes the deep urls still resolve their relative paths to images, etc.
@Ryno: glad it's working for you. I'm hearing some positive feedback about these latest changes, and that just adds to it. In your particular situation, you'd probably want RewriteBase /cms/, but I don't think most people need it at all.
So, I only have a couple more things I want to do... most likely tonight. Then unless anyone objects, I'll be releasing 0.13beta1 before the end of the week.
Re: Clean Hierachical URL's
Ted thanks for the information
now I'm getting a bit weary at the end of the day....
I presume I still just have to set an alias (or let it default if set) on the page for it to work? And don't have to put anything in metadata on the page at all?
Ted, the more I play, the more it looks very cool with the exception of ImageManger - which I know you have in hand and the search. It might just be worth looking at pisearch to see if this can be made to work with this new setup - it would solve a few problems for us in 'accessibility land'
Very cool on the fck {cms_selflink} tags!!
Also, just a thought but I've not been using the cms_selflink plugin because it didn't do what I wanted, but now I see it pretty much does, so another pat on the back, but I was thinking, I currenlty output something like this:
Previous page: Google Safe Search | Top | Next page: Privacy Policy
might it not be an idea to alter the default output to:
Google Safe Search Privacy Policy
(e.g. On the previous link have the link to the left of the label)
Just an idea because if you use it in a footer it makes much more sense?
Looking forward to your reply and the version 0.13 beta, so much so I might not sleep tonight
Russ
Could you or someone explain this a bit further - he says looking blankly@Russ: the {metadata} tag is the bit of code that's inserting the tag into that makes the deep urls still resolve their relative paths to images, etc.

I presume I still just have to set an alias (or let it default if set) on the page for it to work? And don't have to put anything in metadata on the page at all?
Ted, the more I play, the more it looks very cool with the exception of ImageManger - which I know you have in hand and the search. It might just be worth looking at pisearch to see if this can be made to work with this new setup - it would solve a few problems for us in 'accessibility land'

Very cool on the fck {cms_selflink} tags!!
Also, just a thought but I've not been using the cms_selflink plugin because it didn't do what I wanted, but now I see it pretty much does, so another pat on the back, but I was thinking, I currenlty output something like this:
Previous page: Google Safe Search | Top | Next page: Privacy Policy
might it not be an idea to alter the default output to:
Google Safe Search Privacy Policy
(e.g. On the previous link have the link to the left of the label)
Just an idea because if you use it in a footer it makes much more sense?
Looking forward to your reply and the version 0.13 beta, so much so I might not sleep tonight

Russ
Re: Clean Hierachical URL's
Hey Russ,
I think I understand what Ted is saying. The {metadata} tag which needs to be embedded in the head of all templates automatically appends to the metadata you enter for each page when the page renders with this code: or whatever the base path for your site would be.
I'll use an example from my test site. On the page at http://www.seventhvision.com.au/cms/nav ... e-keywords I have in image in the content and without {metadata} tag inserting , the browser thinks the image source is relative to the url.
If the base tag is there though, the browser will now think, ok, disregard the url, I'm being told that the base is http://www.seventhvision.com.au/cms/, therefore the image source will be:
which is correct.
Ted will confirm my above explanation but that's how I understand it. Ted, you are one clever dude!
Ryno
I think I understand what Ted is saying. The {metadata} tag which needs to be embedded in the head of all templates automatically appends to the metadata you enter for each page when the page renders with this code:
Code: Select all
<base href="http://www.seventhvision.com.au/cms/" />
I'll use an example from my test site. On the page at http://www.seventhvision.com.au/cms/nav ... e-keywords I have in image in the content and without {metadata} tag inserting , the browser thinks the image source is relative to the url.
Code: Select all
<img src='http://www.seventhvision.com.au/cms/navigation_menus/navleft/new-search-engine-keywords/uploads/images/myImage.jpg />
Code: Select all
<img src='http://www.seventhvision.com.au/cms/uploads/images/myImage.jpg />
Ted will confirm my above explanation but that's how I understand it. Ted, you are one clever dude!
Ryno