Does this Framework “work”? – modular PHP = dynamic CSS

i’ve been using something lately which i like:

in keeping w/ my experimentation with the most simple bits of code possible, i’ve been setting up my webs (and converting old projects) with all included components– much like one would see in a WordPress Dashboard, perhaps.

so, i’ve basically got 4 pieces; four Modular chunks of XHTML brought into the page via PHP include (or require() ) method :

  • FILENAME (and that which holds the following three items ie. this is a file, not an element within a file)
  • HEADER (for discussion, this will be synonymous with NAVCONTAINER)
  • MAINBODY
  • FOOTER

the key to making this work is dependent upon how well developed is the HEADER element.

the HEADER must be able to give us:

  • DOCTYPE
  • TITLE, METADATA, STYLE, etc — (ie. the HEAD html ele. in full)
  • $BODY_ID – critcal variable, to be named after FILENAME in every circumstance – this will be used in <body id=”$BODY_ID”>
  • NAVCONTAINER (this may be placed elsewhere once you get the concept)

now, i have in my pages, no matter if it’s coldfusion, php, whatever this should work:

FILENAME “gallery.php”
**ATTN: the KEY to she magic-box**
before sending headers, we MUST set a value of $BODY_ID, so we do so here ($body_id = “gallery”), BEFORE the HEADER component is brought into the page! ๐Ÿ˜‰
HEADER (wherein the BODY_ID is named FILENAME — so, $BODY_ID = “gallery”)
MAINBODY – unique to each page – do whatever you want here each time, relevant to the FILENAME
FOOTER – same same same — unless needed to be different, in which case it can be FOOTERv1.0, FOOTERv2.0, etc
illustration

so, now we have our gallery page. everything in that page can be styled uniquely based off of #BODY_ID in the stylesheet because every element of our entire page is (or should be usually) a descendent of that initial node.

there is no need for fiddling w/ code w/in <a href=” this or that blah blah…
because it’s all going to be determined by that BODY_ID — in this manner, the entire page can be modified by simply changing the properties of #BODY_ID in the CSS

does that work for you?
is it as good as Van Halen’s first album? doubtful!!

Whatchu do


One response to “Does this Framework “work”? – modular PHP = dynamic CSS”

Leave a Reply

Your email address will not be published. Required fields are marked *