vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   CMS Fixed Left and Right Columns GRID (https://vborg.vbsupport.ru/showthread.php?t=248667)

midnz 08-15-2010 10:48 AM

CMS Fixed Left and Right Columns GRID
 
1 Attachment(s)
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:

PHP Code:

<?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

Quote:

Originally Posted by CLSSY56 (Post 2088813)
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.
PHP Code:

<?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

Quote:

Originally Posted by ravencr (Post 2101558)
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

Quote:

Originally Posted by ravencr (Post 2101570)
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:
PHP Code:

<?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

1 Attachment(s)
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

Quote:

Originally Posted by ravencr (Post 2101581)
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


All times are GMT. The time now is 02:45 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01077 seconds
  • Memory Usage 1,758KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete