From: Jonathan F. <jon...@fa...> - 2003-12-02 06:29:19
|
Inspired by this site http://www.csszengarden.com I have spent the last couple of days designing a phpws theme using only CSS for both design elements AND content placement. I started by creating a theme.tpl file that looked something like this. (stuff in between <head></head> tags not withstanding) ====================== <div id="container"> <div id="left"> {LEFT_COL_TOP} {LEFT_COL_MID} {LEFT_COL_BOTTOM} </div> <div id="main"> {TOP} {BODY} {BOTTOM} </div> <div id="right"> {RIGHT_COL_TOP} {RIGHT_COL_MID} {RIGHT_COL_BOTTOM} </div> </div> ====================== Then changed my default_box.tpl to be ---------------------- <div id="defaultbox"> <p class="title">{TITLE}</p> <p class="content">{CONTENT}</p> </div> ---------------------- After that, I created a number of other boxes for each phpws "element" ---------------------- <div id="minicalendar"> <p class="title">{TITLE}</p> <p class="content">{CONTENT}</p> </div> ---------------------- <div id="adminmenu"> ... </div> ---------------------- <div id="menu"> ... </div> ---------------------- Etc... Using the layout module to set the custom boxstyle for each "element" I could then manipulate the look and feel of each through the css, plus specify the location/position. An example from my style.css for the calendar is ====================== #minicalendar { position: absolute; top: 50px; left: 560px; display: block; } #minicalendar .title { display: none; } ====================== This means that my mini calendar appears in the upper right hand corner of my site (and actually on top of a nice top banner image specified in the css) even if the mini calendar is actually in the {LEFT_COL_MID} theme variable. SO... Not to bore you with the specifics of css2 absolute and relate positioning tags (http://www.stopdesign.com/also/articles/absolute/) but eventually the standard theme variables {LEFT_COL_TOP}, {LEFT_COL_MID} etc became more of a hindrance than a help. If I wanted to specify an absolute position for the <div id="left"> tag (see theme.tpl example above) but wanted my minicalendar to appear at the top of the page, I was forced to move the the minicalendar element from the Left side to the Right side using the Layout Control Panel "Move Boxes" option. If you can't already guess, that's now out of control. Since the position of the minicalendar content is controlled through the css by the <div id="minicalendar"> from a custom "minicalendar_box.tpl" template file, but the layout module's move buttons appear outside of that div tag, the minicalendar might appear on one side of the page, and the move options for that content might appear some place all together different, and its impossible to match up which move option goes with which element. Essentially, the Move Boxes option of the layout module do not apply to what I am trying to do, nor do I expect them to apply. I started to look for a way to free myself for the move boxes concept of the layout module. I read in the old ./mod/layout/docs/theme_creation.txt file that phpws will default boxes to the {BODY} theme variable if it gets confused about where to place "elements". Well this is really all I want - just to have phpws output all content to the one {BODY} variable, then I can use the Layout module to simply change the boxstyle for each "element" and control their layout through the .css Well I tried to create a theme.tpl file with only a {BODY} theme variable - but am still not sure what to do about the transfers.tpl file. I first tried simply body:2:2 Then tried just having body:1:1 But in both cases I noticed that some elements like the mini calendar and admin menu now appear twice in the final HTML output and I couldn't figure out why or how to prevent this. If anyone has made it this far do you have any ideas to achieve a single theme variable {BODY} in the theme.tpl file and what a corresponding transfers.tpl file would look like? I just need to prevent the double output of some of the "elements". Thanks Jonathan Fallin |