Skinned Websites: Custom Layout Information
One of the problems with a skinned website is that our layout information page either becomes redundant, because we've got more than one layout, or becomes over-crowded because we try and describe every layout on one page (try doing that with 20 skins!)
This simple tutorial allows you to modify the code outlined in my skinning tutorial and then simply have one line of coding which will include your layout information for you.
First, write your information out for each skin and save it as layoutinfo.php in the right skin folder — that's one layoutinfo.php for each skin folder. The layoutinfo.php file doesn't need the header/footer info we put in every other file because the file will be an include itself.
Once you've created all of your information pages, we need to do the following:
- Open header.php and find "
$footer = $pathtoskins . $_COOKIE['myskin'] . "/footer.php";" - Underneath that line, add "
$layout = $pathtoskins . $_COOKIE['myskin'] . "/layoutinfo.php";" - Find "
$footer = $pathtoskins . $defaultskin . "/footer.php";" - Underneath that line, add "
$layout = $pathtoskins . $defaultskin . "/layoutinfo.php";" - Save header.php, upload it and each individual layoutinfo.php file
Once you've followed those steps, you can then just use the line:
<?php include($layout); ?>
..where-ever you want your layout information for each skin (based on whatever skin the visitor has chosen) to appear.
Tags:
php, skinning,
Last Updated On: 24th February 06 by Jem
Bookmark At: StumbleUpon, Digg

Handy Stuff
Downloads
Top Links
Resources