Best way to create absolute url for single event instance?
Permalink
I'm creating a block that will display properties of an event that exists in my database. I'd like to be able to visit a url such as site.com/event_details/12345 and have my block load the event properties where id=12345.
What is the best way to accomplish this? Do I create a single page "object_details" which passes this data into a block that it contains (and override requests to sub-pages somehow)?
I'd rather use this approach than use url parameters so I can hard-link to specific events.
What is the best way to accomplish this? Do I create a single page "object_details" which passes this data into a block that it contains (and override requests to sub-pages somehow)?
I'd rather use this approach than use url parameters so I can hard-link to specific events.
Thanks for the help, I think I am still having some trouble wrapping my head around the core concepts. I have created a page type as you suggested, but I don't understand how I create a instance of this page type. Is this what the "single page" concept is for? Or how do I define the actions that are taken when an instance of this page type is visited?
I was originally thinking of using a block because I wanted to have a controller run a database query using the event id and display the properties inside the block.
I was originally thinking of using a block because I wanted to have a controller run a database query using the event id and display the properties inside the block.
Hi,
http://www.concrete5.org/documentation/introduction/first-concepts...
The above document will help you. Especially the part about pages types and page attributes.
The instance of a pagetype is a page collection object with all the attributes. So when u make a new page, you create an underlying instance of that page type you created.
http://www.concrete5.org/documentation/introduction/first-concepts...
The above document will help you. Especially the part about pages types and page attributes.
The instance of a pagetype is a page collection object with all the attributes. So when u make a new page, you create an underlying instance of that page type you created.
The above has the following benefits:
- beter searchable, and especially when you (later) a search feature added to the site
- the properties are directly linked to the page, so logically structured