i've been using something lately which i like. it seems like it may be just the thing for shaving some time off the ol' dev schedule:
in keeping w/ my experimentation with the most simple bits of code possible, i've been setting up my webs w/ mostly include() components-- much like one might see in a WordPress Dashboard, perhaps.
my method uses basically 4 pieces:
FILENAME -- 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, i believe currently.
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, no matter what pagename i wish to choose, at what stage of development, i can create a correponding CSS ID to style the element named by that ID :
FILENAME "gallery.php"
ATTN: the KEY to she [FONT="Palatino Linotype"]magic-box[/FONT]
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
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.
here's what my "template" page looks like:
<?php
// ENTER HERE THE bodyID
// THIS IS A CSS THING USED TO ENABLE DYNAMIC STYLINGS
$bodyid = "page-namish";
include 'inc/headersinc.php';
?>
<!-- MAINCOL IS THE ONLY UNIQUE CONTENT. IT SHARES VALUE OF PAGENAME -->
<div id="maincol">
<h1>A Unique Header for a Soon-to-be-Unique Content Area</h1>
</div> <!-- END UNIQUE AREA -->
<?php
include 'inc/footer.php';
?>
</body>
</html>
and that's it!!
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!!