Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2010, 10:48 AM
midnz's Avatar
midnz midnz is offline
 
Join Date: Jul 2010
Location: New Zealand
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default CMS Fixed Left and Right Columns GRID

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".



I've attached the above grid as an .xml document for your convenience.
Attached Files
File Type: xml Sidebar + Column + Sidebar 180px, 100%, 240px.xml (823 Bytes, 100 views)
Reply With Quote
  #2  
Old 08-24-2010, 12:20 PM
CLSSY56 CLSSY56 is offline
 
Join Date: May 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 08-24-2010, 07:08 PM
midnz's Avatar
midnz midnz is offline
 
Join Date: Jul 2010
Location: New Zealand
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CLSSY56 View Post
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>
Reply With Quote
  #4  
Old 09-21-2010, 07:27 PM
ravencr ravencr is offline
 
Join Date: Feb 2007
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 09-21-2010, 07:49 PM
midnz's Avatar
midnz midnz is offline
 
Join Date: Jul 2010
Location: New Zealand
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ravencr View Post
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 .
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.
Reply With Quote
  #6  
Old 09-21-2010, 08:07 PM
ravencr ravencr is offline
 
Join Date: Feb 2007
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Didn't work again...the names of the div class is wrong
Reply With Quote
  #7  
Old 09-21-2010, 08:10 PM
midnz's Avatar
midnz midnz is offline
 
Join Date: Jul 2010
Location: New Zealand
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ravencr View Post
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>
Reply With Quote
  #8  
Old 09-21-2010, 08:26 PM
ravencr ravencr is offline
 
Join Date: Feb 2007
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Attached Images
File Type: jpg 1.jpg (44.9 KB, 0 views)
Reply With Quote
  #9  
Old 09-21-2010, 08:32 PM
midnz's Avatar
midnz midnz is offline
 
Join Date: Jul 2010
Location: New Zealand
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ravencr View Post
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.
Reply With Quote
  #10  
Old 09-21-2010, 08:42 PM
ravencr ravencr is offline
 
Join Date: Feb 2007
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've discovered it's all in the vbcms.css file
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:24 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04478 seconds
  • Memory Usage 2,287KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete