Forum Moderators: coopster & phranque

Message Too Old, No Replies

CMS Idea

Would this work?

         

ukgimp

3:24 pm on May 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would like to try and create a CMS that would work on the principle similar to a directory. I would like all the articles/pages to be dynamic, served on the fly with a fake dir structure that uses the mod rewrite to get the stuff out the db.

There would be two main tables one with the articles etc and a subject one with a parent relationship field.

Here goes:
Imagine that the directory structure for a particular page was:
/A_dir/B_dir/C_dir/D_dir/
Within the fake dir_D are a set of pages called 1.php – n.php plus the index.

Now the regex could pick out the page number and the name of the directory preceding it. It could then put them into the original url and do the old hidden redirect.

Page.php?pageid=1&subject=d_dir

These two parameters would allow me to get the article for any fake dir and subsequent page with a few simple sql selects

Now when printing the links you could select the ID from the subject table where directory name = D_dir and do a recursive query back up the chain and what them in an array[]. Then print out the array with the appropriate:

/array[0]/array[1]/array[2]/array[3]/1.php

doe what I propose sound possible or even like a good idea and would it scale. If yes it would allow for an unlimited number of pages to be created in an infinite number of “fake” directories.

Or am I just freakin’ nuts and should call it a day and go to the boozer?

Yours etc

BCMG_Scott

4:16 pm on May 23, 2003 (gmt 0)

10+ Year Member



Sounds workable, but the big question - WHY?

LOL. My personal feeling on this is if you have a page that has no dynamic content it should just be plain HTML. Why add the overhead of a DB and PHP if it's just static HTML. If you are building pages customized to the visitor then it makes sense.

I don't think it's "freakin' nuts" , but feel free to go to the boozer anyway. I've discovered some great ideas after a beer or two. LOL

Scott

ukgimp

11:47 am on May 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why?

Well is that not how large dynamic sites are done?

Showing my ignorance here. Or is the way forward a template engine. If yes, anyone knw of a good "how it works" guide or one of those those data downloads that I saw in the first Matrix?

jaski

1:11 pm on May 27, 2003 (gmt 0)

10+ Year Member



I take that you are trying to build a dynamic page serving system and use static urls.

If so .. I have been using this technique. Its plain PHP with .htaccess file. (I assume you are using Apache)

Say your php file is xyz.php
You can save it as xyz ie. without .php extension and then modify .htaccess file

<Files xyz>
ForceType application/x-httpd-php
</Files>

This will tell apache that xyz is a php file.

You will be able to write urls of the type
www.abc.com/xyz/param1/param2
Or
www.abc.com/xyz/param1/param2.htm
instead of www.abc.com/xyz.php?q=param1&p=param2

madcat

1:22 pm on May 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will be able to write urls of the type
www.abc.com/xyz/param1/param2
Or
www.abc.com/xyz/param1/param2.htm
instead of www.abc.com/xyz.php?q=param1&p=param2

For the uninitiated, what are the benefits of doing the former?

ukgimp

1:30 pm on May 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Search engines can struggle with dynamic urls. Urls that are dynamic but appear static are somewhat of a holy grail.

People are also more likely to link to a non dynamic looking url.

www.abc.com/xyz.php?q=param1&p=param2

the stuff after the "?" is what casues the problem.

aspr1n

1:32 pm on May 27, 2003 (gmt 0)

10+ Year Member



Hi ukgimp,

Conceptually this is exactly what I am doing on one of our sites, except we consider them to be 'Categories' rather than directories, though the outcome is the same.

The way I designed it was:

Categories are created as a parent child relationship. A document is created in the CMS and assigned to a category. Each category is also assigned a 'Category Home Page', thus user can request a specific document within a category, or the root '\' of the category, and be served the 'home page' assigned to that category.

Categories also dynamically build the entire site navigation, and editing categories adds/removes the site navigation, depending on the category 'type' determines which menu and where.

Just to prove it is possible, there is only one php webpage in the entire site, everything else is stored in a MySQL database and built on the fly, with CSS providing the styles.

A simple front end allows you to 'edit', 'sort', 'delete', documents and categories. Documents and Categories must also be flagged as 'Published' for the cat/doc to be viewable & searchable. Also because of the nature of the site, some of our documents are also flagged as 'Disclaimer' again which is built on the fly with css.

I have some more stuff to do to use Apache mod_replace to transpose static uris to dynamic PHP ones for the SEs,.

One of the nice features of this is rather than a plain 404 page, if the category\document does not exist a text query is done in MySQL to list the most appropriate categories and documents.

This takes some time and patience, but is well worth it.

asp

BCMG_Scott

1:05 pm on May 28, 2003 (gmt 0)

10+ Year Member



Well is that not how large dynamic sites are done?

Ahhh - you are probably correct. I deal with mostly static content (other than public message boards) and don't see a need to do this. But a large dynamic site could probably use something like that.

And I think you hit it right on the head, poeple don't like the query string in the URL.

I like the idea aspr1n put forward.

Scott

aspr1n

2:21 pm on May 28, 2003 (gmt 0)

10+ Year Member



... well I haven't heard from ukg since I stickied him the url, so I don't think he approved ;)

asp

ukgimp

2:34 pm on May 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thats not fair :)

Have not had a good look at it yet