Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

How do you extend the URL


Reply


4 Posts   1064 Views

Avatar
musicfreak1995

Community Member, 28 Posts

22 January 2010 at 12:02pm

for example if you had a long SUB-PAGE area

HOME
-COMMENTS
--INTERACTIVE
---DETAILS

Instead of (DETAILS) being http://mysite.com/details/
How do I make the address
http://mysite.com/home/comments/interactive/details

I tried ways but ended up messing the silverstripe software up and restart the installation!!!

Avatar
Judge

Community Member, 79 Posts

22 January 2010 at 12:29pm

Edited: 22/01/2010 12:33pm

I understand it is not yet possible, but there are plans to introduce it in a later version.

In theory it should not be too difficult to implement; the URL handler just needs to match the longest path it can, and then pass the remaining path parts on to the module page that points at.

At the moment, just being one level, SilverStripe knows there will never be a clash of URLs. With extended paths there could be, but that's really for the administrator to deal with IMO.

For example, is /home/comments/interactive a page or module called "home" with "comments" and "interactive" passed in as parameters? Or is it a page called "/home/comments" with "interactive" as a parameter (e.g. a category of items to display in that page). I guess those are the kinds of things that need to be worked out.

I wrote a handler for another CMS that deals with this problem, and that just did longest-path matches. Where there was no ambiguity, it would also match any part of a path, e.g. "interactive" would be an alias of "/home/comments/interactive" so long as there was only one page called "interactive".

Another subsequence of this is that several different pages can have identical names, but the context of the path allows the CMS to decide which page is the target. e.g. two different pages could be called "news", but one is under "local" and the other is under "national", so the pages would be accessed as "/local/news" or "/national/news". It could also have been "/news/local" and "/news/national", but the potential problem does not go away because "local" and "national" could also be pages in other areas of the site.

-- Jason

Avatar
Willr

Forum Moderator, 5513 Posts

22 January 2010 at 2:41pm

SFalepau - download the 2.4 alpha and have a play with that. That has nested urls included which is what you're looking for :D.

Avatar
musicfreak1995

Community Member, 28 Posts

27 January 2010 at 1:56pm

I tried modifing some codes of Silverstripe 2-2.0-alpha to Silverstripe 2-2.5 but never works!

Is there a module to configure making urls do
http://example.com/home/page2/page3/page4/....

like so forth???