View Full Version : CMS Fixed Left and Right Columns GRID
midnz
08-15-2010, 10:48 AM
After finding very little information to help CMS novices like me to get fixed width left and right columns, and having to work it out for myself, I thought I'd share with those who are still struggling with the default vB 4.0.6 grid layouts being insufficient for your needs.
The key is to download the default grids.xml to see how they're made: Grid Manager > Download/Upload Grids.
I needed both the right and left columns to be of fixed widths (180px & 240px) and with a fluid middle column (100%). See the code below to see how easy it is to accomplish yourself:
<?xml version="1.0" encoding="UTF-8"?>
<grids>
<grid name="Sidebar + Column + Sidebar (180px, 100%, 240px)" auxheader="0" auxfooter="0" addcolumn="1" addcolumnsnap="1" addcolumnsize="3" columns="0"><![CDATA[<div id="doc3" class="yui-tvb-r3">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-gf">
<div class="yui-u first yui-sidebar">
<ul class="list_no_decoration widget_list" id="widgetlist_column1">$column[1]</ul>
</div>
<div class="yui-u yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column2">$column[2]</ul>
</div>
</div>
</div>
</div>
<div class="yui-b yui-sidebar">
<ul class="list_no_decoration widget_list" id="widgetlist_column3">$column[3]</ul>
</div>
</div>
</div>
]]></grid>
</grids>You just need to save the above code as an .xml document and upload using the Grid Manager > Download/Upload Grids. Make sure that you name the new grid.xml clearly so that you'll recognise it in the Grid Manager. I named the above grid "Sidebar + Column + Sidebar 180px, 100%, 240px.xml".
http://img37.imageshack.us/img37/7082/gridyl.jpg
I've attached the above grid as an .xml document for your convenience.
CLSSY56
08-24-2010, 12:20 PM
Do you have time to explain it to me. I don't see where the width parameters are. I am not good with HTML or PHP, I just muddle through it. I'd like to take yours and make a 200-fluid-250 grid.
midnz
08-24-2010, 07:08 PM
Do you have time to explain it to me. I don't see where the width parameters are. I am not good with HTML or PHP, I just muddle through it. I'd like to take yours and make a 200-fluid-250 grid.
Don't worry. I'm a muddler too and discovered how to make the changes by fluke.
To change my grid to what you require just change the numbers within the brackets.
from:
(180px, 100%, 240px)
to:
(200px, 100%, 250px)
It really is that simple :).
The only other edit that needs to be made would be if any of the three columns were being changed from a fixed to fluid or fluid to fixed width. It's not in your case so you don't have to be concerned about it.
Fixed width columns need to use:
<div class="yui-u first yui-sidebar">
Whereas fluid width columns need to use:
<div class="yui-u yui-panel">
Try this. I've only changed the size values within the brackets.
<?xml version="1.0" encoding="UTF-8"?>
<grids>
<grid name="Sidebar + Column + Sidebar (200px, 100%, 250px)" auxheader="0" auxfooter="0" addcolumn="1" addcolumnsnap="1" addcolumnsize="3" columns="0"><![CDATA[<div id="doc3" class="yui-tvb-r3">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-gf">
<div class="yui-u first yui-sidebar">
<ul class="list_no_decoration widget_list" id="widgetlist_column1">$column[1]</ul>
</div>
<div class="yui-u yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column2">$column[2]</ul>
</div>
</div>
</div>
</div>
<div class="yui-b yui-sidebar">
<ul class="list_no_decoration widget_list" id="widgetlist_column3">$column[3]</ul>
</div>
</div>
</div>
]]></grid>
</grids>
ravencr
09-21-2010, 07:27 PM
I copied this and it just gives me everything in one big column. I need a 20%, 60%, 20%, so I changed the sidebar to panel, took out the first, but the last one has a b instead of a u. Any ideas?
Chris
midnz
09-21-2010, 07:49 PM
I copied this and it just gives me everything in one big column. I need a 20%, 60%, 20%, so I changed the sidebar to panel, took out the first, but the last one has a b instead of a u. Any ideas?
Chris
I downloaded my default CMS grid.xml and found the closest match to what you wanted was "3 Column (25%, 50%, 25%)" because that grid uses no fixed widths and has three columns and so I changed the values to "3 Column (20%, 60%, 20%)". I also changed "<div class="yui-tvb-l25 first yui-panel">,<div class="yui-tvb-l50 first yui-panel"> and <div class="yui-tvb-l25 first yui-panel">" to "<div class="yui-tvb-l20 first yui-panel"><div class="yui-tvb-l60 first yui-panel"> and <div class="yui-tvb-l20 first yui-panel">".
I've attached (removed-didn't work) this new grid for you to try. Hopefully it works :p.
NOTE: I'm unsure whether the name displayed for each grid is derived from the code or the .xml document name and so I've played it safe with the naming of this new .xml document.
Before you upload this new grid, download your default grid.xml ... just in case things don't work.
ravencr
09-21-2010, 08:07 PM
Didn't work again...the names of the div class is wrong
midnz
09-21-2010, 08:10 PM
Didn't work again...the names of the div class is wrong
Try changing those three div classes to <div class="yui-u yui-panel"> except the first one which you can try with <div class="yui-u first yui-panel"> to see if that works.
IE:
<?xml version="1.0" encoding="UTF-8"?>
<grids>
<grid name="3 Column (20%, 60%, 20%)" auxheader="0" auxfooter="0" addcolumn="0" addcolumnsnap="0" addcolumnsize="1" columns="0"><![CDATA[<div id="doc3">
<div id="bd">
<div class="yui-g">
<div class="yui-u first yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column1">$column[1]</ul>
</div>
<div class="yui-u yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column2">$column[2]</ul>
</div>
<div class="yui-u yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column3">$column[3]</ul>
</div>
</div>
</div>
</div>
]]></grid>
</grids>
ravencr
09-21-2010, 08:26 PM
No, unfortunately. Here's what it looks like now. There's one column on the left and the other two or sort of stacked on top of each other.
midnz
09-21-2010, 08:32 PM
No, unfortunately. Here's what it looks like now. There's one column on the left and the other two or sort of stacked on top of each other.
Hmmmm .... I'll enable my CMS and do some experimenting to see if I can come up with something that definitely does what you want.
ravencr
09-21-2010, 08:42 PM
I've discovered it's all in the vbcms.css file
midnz
09-21-2010, 09:20 PM
I've discovered it's all in the vbcms.css file
Yeah, that's where I'm looking too.
ravencr
09-21-2010, 09:31 PM
I fixed it by just changing the css. I was able to add one for 15%, but for whatever reason when I tried to add one for 20% to make a 15%, 65%, 20% it wouldn't work unless I used the existing one they had in there. Very confusing...
midnz
09-21-2010, 09:43 PM
I fixed it by just changing the css. I was able to add one for 15%, but for whatever reason when I tried to add one for 20% to make a 15%, 65%, 20% it wouldn't work unless I used the existing one they had in there. Very confusing...
Excellent. I'm glad you've solved it :). Now I can stop battling with vb.org and vb.com needing multiple page refreshes just to navigate anywhere. I'll have to look further in to that some day.
ravencr
09-28-2010, 05:35 PM
k, so I've decided to go to a fixed, fluid, fixed combo for the grid, but I can't figure it out...imagine that. Can anyone on here tell me how to do a 200px, 100%, 200px and a 240px, 100%, 240px grid xml? Thanks for the help,
Chris
midnz
09-28-2010, 07:37 PM
Try these. No guarantee that they'll work though. I've removed my CMS in favour of using Logician's Webtemplates and so I can't test on my board. If they don't work then those widths probably aren't defined in the .css
<?xml version="1.0" encoding="UTF-8"?>
<grids>
<grid name="Sidebar + Column + Sidebar (200px, 100%, 200px)" auxheader="0" auxfooter="0" addcolumn="1" addcolumnsnap="1" addcolumnsize="3" columns="0"><![CDATA[<div id="doc3" class="yui-tvb-r3">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-gf">
<div class="yui-u first yui-sidebar">
<ul class="list_no_decoration widget_list" id="widgetlist_column1">$column[1]</ul>
</div>
<div class="yui-u yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column2">$column[2]</ul>
</div>
</div>
</div>
</div>
<div class="yui-b yui-sidebar">
<ul class="list_no_decoration widget_list" id="widgetlist_column3">$column[3]</ul>
</div>
</div>
</div>
]]></grid>
</grids>
<?xml version="1.0" encoding="UTF-8"?>
<grids>
<grid name="Sidebar + Column + Sidebar (240px, 100%, 240px)" auxheader="0" auxfooter="0" addcolumn="1" addcolumnsnap="1" addcolumnsize="3" columns="0"><![CDATA[<div id="doc3" class="yui-tvb-r3">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-gf">
<div class="yui-u first yui-sidebar">
<ul class="list_no_decoration widget_list" id="widgetlist_column1">$column[1]</ul>
</div>
<div class="yui-u yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column2">$column[2]</ul>
</div>
</div>
</div>
</div>
<div class="yui-b yui-sidebar">
<ul class="list_no_decoration widget_list" id="widgetlist_column3">$column[3]</ul>
</div>
</div>
</div>
]]></grid>
</grids>
ravencr
09-28-2010, 07:41 PM
I appreciate it...I ended up hiring a guy to knock it out...sick of messing with it, honestly.
Chris
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.