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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

dynamic URLS


Go to End


2 Posts   1209 Views

Avatar
danzzz

Community Member, 175 Posts

7 March 2011 at 5:10am

hi

just working on a site where I have a product directory. I also have users. The can login and create own "lists" with products they love. From the datamodel site it's all done ... Members <-> Products (many_many).

Now I want that the users can see their products (they love) under this URL:

http://www.example.com/USERNAME/mylist1
or
http://www.example.com/USERNAME/mylist2

How to setup an eviroment which can handle this URLs?

thx

Avatar
danzzz

Community Member, 175 Posts

7 March 2011 at 7:49am

this helped me:
http://www.ssbits.com/tutorials/2011/using-a-nested-controller-for-generic-url-handling/

I test if the URLSegment is one of the usernames and if so I use a own controller, like here:
http://www.ssbits.com/tutorials/2011/controllers-instead-of-pages/