Dynamic Page URL

I am building a site for searching Apartments accross the U.S. When landing on a property page, I need it to dynamically include the State and City attribute in the page URL. Is this easily doable? And how would I go about it? I am quite adept in customizing C5 but have never had to modify the URL of a page like this.

Current path shows ashttp://www.mywebsite.com/properties/test-property/...
What I need ishttp://www.mywebsite.com/properties/state/city/name_of_property/...

Any help out there?

View Replies:
JohntheFish replied on at Permalink Reply
Simplest is to create the pages in that structure



Alternatively, you could create a single page and have a single page controller that takes parameters from the path. Below is pseudocode, not complete compilable code
class Whatever extends Controller{
function view($statename, $cityname){

If you opt for that, you will need to design the whole system about that single page controller.
aaronmarp replied on at Permalink Reply
I wish it was that easy. The main issue is that multiple "Property Owners" will be creating their own properties via Composer in the Dashboard. So I am looking for a way to automatically associate their listing by the address they enter in the Address Attribute. And then reflect that in the URL of the property when viewed.

Even if it was possible to create a new page for a city that doesn't exsist if a property is created with that city. In essence, create the city category page automatically if it didn't already exsist. Then add that property to it.
JohntheFish replied on at Permalink Reply
You would need to re-write the url slug translating code.
MrKDilkington replied on at Permalink Reply
Hi aaronmarp,

I believe this might be an example of the code JohntheFish is referring to.

This code is on my todo list and I have not tried it yet, but I think it might work for your situation.

In the PageHandler class placePost() method, instead of using year and month for the path, you could use a state attribute and city attribute.