Combining SE friendly URL structure with content management
Posted 20 June 2006 - 12:40 AM
I've seen some CMS's that support the friendly URL's but I would like the entire structure to be defined within.
A complete "virtual site structure". No pages, except the neccessary code of course, everything else contained within the db. So I could just add [a href=\"http://mysite.com/hello/world\" target=\"_blank\"]http://mysite.com/hello/world[/a] and then be able to create pages within that directory.
I'm also trying to find a way of managing this structure as easily and efficient as possible since I know that each time a page would be accessed the recursion would yield a lot of queries.
Thanks in advance.
Posted 20 June 2006 - 12:48 AM
Posted 20 June 2006 - 12:55 AM
You would need a table, say called pages, with an id, title, text for example. If you would need to group pages into categories add a category_id field and a categories table to match.
You could use tinymce for the editor to help the cms users edit the text in each page.
Then to access an individual page you could do it like this www.domain.com/1/1/ which mapped to index.php?category=1&page=1 (by Apache's mod_rewrite) would then give you the page (just fetch the row from the database).
Of course, if you would like to use the category name and page title, just use those instead of the id numbers. So, this
would map to this
You would then have to make sure that there isn't more than 1 page with the same title in each category.
Just my quick thoughts. Hope it helps.
Posted 22 June 2006 - 01:29 AM
Here is a more refined question directed towards this mean.
How would I go about matching a string, such as [a href=\"http://mysite.com/category1/subcat2/subsubcat3/my-article-on-something.html\" target=\"_blank\"]http://mysite.com/category1/subcat2/subsub...-something.html[/a] with it's proper entry in a Db based hierarchy. I guess that is what I'm really trying to get at. I have no idea how I could go about looping through parent/child relationships or once i break the url into an array, how i could go about getting a specific entry via this manner.
If you have any experience with this, I would greatly appreciate the help. I'm pretty new with all this and am still trying to get oriented, so any help on the way to setup the table and the neccessary code would be helpful.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users