Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Urls, why no 'sublevel' urls?

Our old forums are still available as a read-only archive.

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

Page: 1 2 3 4 5 6 7
Go to End
Author Topic: 31437 Views
  • Sigurd
    Avatar
    Forum Moderator
    628 Posts

    Re: Urls, why no 'sublevel' urls? Link to this post

    You can see there's been a nice lot of development done on this in the last month:

    http://open.silverstripe.com/log/modules/sapphire/branches/nestedurls?rev=64221 shows some of work done over that time period.

  • haswalt
    Avatar
    Community Member
    16 Posts

    Re: Urls, why no 'sublevel' urls? Link to this post

    Is this in a workable state yet?

    Could we get away with checking this out and working it into our current development?

    Harry

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Urls, why no 'sublevel' urls? Link to this post

    You can try it out for yourself by downloading the code via subversion -

    Or you can download the zip at http://open.silverstripe.com/changeset/latest/phpinstaller/branches/nestledurls?old_path=/&filename=/phpinstaller/branches/nestledurls&format=zip I believe.

    I don't think the code is production ready just yet but some good work being done so far

  • haswalt
    Avatar
    Community Member
    16 Posts

    Re: Urls, why no 'sublevel' urls? Link to this post

    I think i may have found a better solution to this anyway.

    I will let everyone know once it works completely and if my boss let's me release the code.

    But as a heads up it's a very similar method to the way symfony handles custom urls.

    Harry

  • cshtauralrets
    Avatar
    Community Member
    9 Posts

    Re: Urls, why no 'sublevel' urls? Link to this post

    I have a site as such, where there are perhaps 100 Things, so having the urls be /Bar-[0-100] is really undesirable. Thanks for the work on this feature.

    Thing
    - Bar
    - Baz
    - Eggs
    Thing2
    - Bar
    - Baz
    - Eggs

    By the way, if I'm currently building a site as shown above, is there anything I should do now to make it easier in the future to have the site nest urls? If I build the site now with the current functionality, will I be able to take advantage of this feature when and if it's implemented?

    Thanks.

  • mobiusnz
    Avatar
    Community Member
    3 Posts

    Re: Urls, why no 'sublevel' urls? Link to this post

    If nested urls do become part of the core (as I hope), has there been much thought as to what to do with functions? /page/function wouldn't work too well as sub-pages might step on needed functions (or vice-versa).

    Maybe there could be an option to specify how we want functions to be delimited? Some examples would be:

    site.co.nz/page/sub-page#function
    site.co.nz/page/sub-page?function
    site.co.nz/page/sub-page.function
    site.co.nz/page/sub-page~function

  • ajshort
    Avatar
    Community Member
    244 Posts

    Re: Urls, why no 'sublevel' urls? Link to this post

    By default, if there is a conflict, the page takes priority over an action. However, if you define an $allowed_actions on your controller (a good idea), any action conflicts found in this will be automatically rewritten.

  • Hubertus
    Avatar
    Community Member
    14 Posts

    Re: Urls, why no 'sublevel' urls? Link to this post

    I suggest to introduce a default "index" function to somewhat emulate the standard of delivering an index.html when a directory is called.

    A request to root/page/subpage/ would be handled by that default function and simply display the content of subpage (just as root/subpage would do right now), while root/page/subpage/add would execute the specific add function on subpage (root/subpage/add in SS 2.2).

    In other words: a slash at the end of the URL simply displays that page, while anything after the last slash is a specific function. This way, pages can be nested as deep as one wants and still have a function, both with pretty and meaningful URLs.

    31437 Views
Page: 1 2 3 4 5 6 7
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.