17488 Posts in 4473 Topics by 1978 members
| Go to End | Next > | |
| Author | Topic: | 30754 Views |
-
Re: Urls, why no 'sublevel' urls?

10 April 2008 at 8:46pm Last edited: 10 April 2008 8:49pm
I actually had to drop the idea of using SS on my last project since the customer would want to keep his urls the ways they've always been:
/product_a/support
/product_b/supportBesides the amount of code that needs to be changed wasn't it a major design flaw to interpret the urls as /path/action?
Since you expect mod_rewrite to be used anyway one could have a more generic system using parameters (action="", page="") and rewriting into nice urls.
Edit: A sidenote on this forum software/plugin. When writing a new post there is a tiny 'Post' button on the lower left but one easily clicks on the prominent 'Reply' button on the lower right ending up having to write the post again.
-
Re: Urls, why no 'sublevel' urls?

6 June 2008 at 1:38am Last edited: 6 June 2008 1:39am
I'm new to SilverStripe as well, and first off, I'm very impressed. I'd characterize it as an "everything you need, nothing you don't" type of CMS.
Unfortunately, the one functionality showstopper in implementing it for our group is the lack of hierarchical URLs.
One solution that I haven't seen mentioned in any of the posts on the topic (although I may have just missed it!) is to use the site navigation hierarchy to determine URLs. In the current model, lets say we had a top level page called "AboutUs", (URL "/AboutUs/"), and then a subpage called "Our Staff" (URL "/OurStaff/"). What would make sense to me is rather than ONLY having a top level URL, to use that page-subpage relationship to determine the URL, and give the subpage a URL of "/AboutUs/OurStaff/".
Since those page-subpage relationships are already in the database, I would think it would be possible to only specify the URL fragment (i.e. "OurStaff") for the subpage in the user interface, and have it build out the hierarchy in another field in the database to use in conjunction with the mod_rewrite rule.
This way, the URL is absolutely tied to the hierarchy in the interface, and there's no manual maintenance (which we definitely don't want!) or ambiguity (Did someone mean their "Products/Services" page, or is "Services" a subpage of products?").
As far as fixing the hierarchy if you change a parent, we'd know when the parent changed, so we could then go through and update URL for the children.
Just off the top of my head, I'd suggest something along these lines:
- Add a "FullURL" field to the "SiteTree" table.
- Create a "calculateFullURL" MySQL procedure that would concatenate the parent's "FullURL" field with the subpage's "URLSegment" field. This procedure would also recursively run itself for all of its children.
- Create "update" and "insert" triggers on the SiteTree table to run that procedure.
- Modify the code that does that initial lookup to use the "FullURL" field rather than the "URLSegment" field.
- Modify the user interface so that on the form where you're specifying the URL segment, it prepends the parent's FullURL as text to the text box where you specify the URL segment.
Of course, that's a very simplified version, and you could also execute the same logic in PHP. It's just easier for me to describe in SQL terms since I haven't really looked into the code.
-
Re: Urls, why no 'sublevel' urls?

18 June 2008 at 10:11pm Last edited: 18 June 2008 10:12pm
What is going on with this? I personally think that sublevel URLs should be part of SS and I'm seeing quite a bit of enthusiasm for it in the forums. However, the SS team originally designed it this way for a reason and it has apparently worked very well for them in the past.
Is there a really good reason for sublevel URLs or do we want it only because its always been done that way?
-
Re: Urls, why no 'sublevel' urls?

17 July 2008 at 10:41am
what about implementing the sublevel urls using the PageHolder/Page system you have developed as an standard for category/page?
looks pretty intelligent to me have something like this implemented.
if you want a url like animals/dog
you need to have at least 2 classes, one AnimalsHolder and one AnimalsPage for do the trick.
so the urls become mysite.com/AnimalsHolder/AnimalsPagesounds coherent?
-
Re: Urls, why no 'sublevel' urls?

17 July 2008 at 1:54pm
dospuntocero, your not talking about creating a new class/sub-class for every type of URL are you? So if you want to have pages about animals you create an animal class, when you want to talk about automobiles you create an automobile class, etc... That doesn't seem very scalable.
Either way, I'm probably misunderstanding you. I havent played with SS much and don't know about the Page Holder/Page thing. Is that built-in to SS or an extension?
Later...
Richard -
Re: Urls, why no 'sublevel' urls?

4 August 2008 at 1:51am Last edited: 4 August 2008 2:07am
The web is based on URLs. A URL is a unique id for a resource. Unfortunately all the big content management systems I've ever tested break this and force the user to have a completely flat structure i.e., if the pages were actual files, they'd all be in the same directory. Some then try and cludge some URLs to make it look like there's a structure to the site.
I've tested 20+ CMSs this weekend trying to find one that does things properly to be used as an eCommerce site and I've found one. Unfortunately it's not mature enough to give to a non-developer so the search continues.
Edit
Just found one via OpenSourceCMS called Website Baker. I have no idea how good it is, but it got this part right. -
Re: Urls, why no 'sublevel' urls?

4 August 2008 at 2:10am Last edited: 4 August 2008 2:11am
I've tested 20+ CMSs this weekend trying to find one that does things properly to be used as an eCommerce site and I've found one. Unfortunately it's not mature enough to give to a non-developer so the search continues.
What do you mean when you say: "does things properly"? Regarding URLs with multiple Levels? If you're looking for a feature like that in a CMS, you didn't look that hard. 2 CMS come to mind instantly: drupal or MODx
Maybe you could call MODx "not mature" (i wouldn't), but certainly not drupal.
Drupal needs some further configuration, see http://drupal.org/node/15365 and http://drupal.org/handbook/modules/path. MODx does the URL rewriting "out of the box". -
Re: Urls, why no 'sublevel' urls?

4 August 2008 at 5:38am
There is a patch in development that supports sub URLs. I've only tested it shortly on a development SS setup, and it seemed to work nicely. Can't say how stable it is, as I only just played around with it - nothing too serious.
| 30754 Views | ||
| Go to Top | Next > |




