|
Posted by Rik on 02/12/07 23:29
On Tue, 13 Feb 2007 00:11:29 +0100, Susanne West <swest@gmx.de> wrote:
> i'm tackling a bigger project that will use mod_rewrite to patch
> a series of urls into a master php-script. this script builds the
> page framework that contains a series of elements that remain on
> every page. only a center part (a <div>) is filled with different
> contents, depending on how the page is called (= mode of the page).
> the point is, there are quite a few (approx 20) different 'modes'
> for the center part to be filled with.
>
> so now i wonder, what kind of approaches you guys use to keep the
> project and all the subpages/includes/static elements as flexible
> and clear as possible. there's really many ways to do this but i
> can't yet decide on 'the right way' to do it...
>
> let me examplify this:
>
> /program > index.php?mode=program
> /movie > index.php?mode=movie
> /reservation > index.php?mode=reservation
> etc...
>
>
> +-------------------+
> |menu |
> |calendar |
> |etc.. |
> | +--------------+ |
> | | content 1 | |
> | | ... | |
> | | content 20 | |
> | | | |
> | +--------------+ |
> | footer, banner... |
> +-------------------+
>
>
> - one way would be to have a master php script and include ALL
> subitems
> - another way would be to make many master pages for evey mode and
> only include the framework-items (= every page-type can be
> edited as one, only the framework-items are detached).
> - then the version with the exact opposite:
> index.php (with menu, calendar, footer elements fix)
> content1.inc
> content2.inc
> content3.inc
>
> - make one HUGE page with all the subelements in the same script
> and tons of switches and if's to turn them on and off.
> what would you suggest? is there a way that i'm missing?
> speedwise, all the versions should be more or less that same...
Bigger project -> go for a database.
Specify in the database what modes require what scripts, what pages have
what content (possibly storing flat HTML directly in the database for easy
maintainability). Make an interface for it, and presto, with u few
buttonclicks most of the pages adapt directly to how you want them,
without fiddling about in tons of files.
I usually define one or several layouts, store a page-tree in the database
and link layout-id's to the pages as desired. Create content (where
'content' can be flat HTML, the name of a (php-)file to include, some
custom wrapper around a certain database-queries, etc.), and again link
that to the pages. Voilà, the beginnings of your own custom build CMS.
--
Rik Wasmus
Navigation:
[Reply to this message]
|