November 22nd, 2004, 14:56Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/web114/htdocs/ag/wp2/wp-includes/functions-formatting.php on line 83
After quite a bit of thinking of how to structure a single page in a CMS, I’ve came up with the following (written in my struct-file, so please forgive me the shortness/strangeness of this entry):
- per page/category (articles):
- page_template - contains page template:
- <!–#insert: [post name] –> - inserts post with given name
- <!–#insert-id: [post id] –> - inserts post with given id
- <!–#include: [/path/to/file.php] –> - includes given file from given path (html, php, etc)
- determination between category and page via
We also would have to change the name ‘post’ - instead we would have to call it a ‘page’ or maybe even ‘page content’.
Next on my to-do-list is how to structure the URLs, so maybe instead of using
'category/subcategory/23-my-name-is-dumb.html') we should use ‘http://www.my-domain.com/my-category/’ using the trailing slash as a determiner for categories and a file extension like as shown in the following example as the one for pages: ‘http://www.my-domain.com/my-category/welcome.php’.
Then, there is still this problem about adding a query string to a URL - wouldnt the mod_rewrite engine do remove the query string, maybe mix it all up or just do the crapper? We also wouldnt want to have any query string to make the URLs proper crawl-able by any given search engine. To avoid all of that trouble, let’s think about it for a moment, and then use something like this: If the URL containts above mentioned file extension, anything after it get’s added to the internal big query string, as it should be. Following example should make my idea better understand-able:
'http://www.my-domain.com/hosting/plans.php/id/bizpro/' would be translated into
'http://www.my-domain/index.php?id=2&category=3&query_id=bizpro' - to avoid trouble with variables of the same name (doublets of a variable), we add a ‘query_’ to any variable passed to the script via the query string from ‘outside’.
Using these simple rules, we wouldnt have to quarrel with stuff like how to set up a proper URL structure, using semi-dynamic files instead of this only virtual available directory structure (thanks to the mod_rewrite engine). If we want to include stuff like a script part that displays data stored in a different table, like I do with my hosting plans (they’re generated on the fly), you simply would have to include them via above mentioned template structure. And if there was some query string you might want to add, you’re still on the safe side as search engines, web hosting lists like Webhostlist.de, etc. would still be able to proper crawl to or link to your website