Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[HOW TO - vB4] Two column forum/sub-forum setup via CSS only
Lynne's Avatar
Lynne
Join Date: Sep 2004
Posts: 41,180

 

California/Idaho
Show Printable Version Email this Page Subscription
Lynne Lynne is offline 11-20-2009, 10:00 PM

This is just a quick writeup of the very basics to achieve a two column setup for your forums through only the use of CSS - no template modifications or plugins required. (Original thread requesting this infomation is here.)

I am NOT going to be teaching CSS is this article! You WILL need to have some basic understanding of what Cascading Style Sheets are all about in order to further change this since this is only the basics to put stuff in position with no padding or margins or any other styling applied - that is up to you to do.

This was written during the beta3/beta4 testing and may need to be modified for use with other versions since classes may be changed as the style has not been finalized yet. This was written to work with the default style and default stylevars (default at this time, that is). If you have customized your style in any way, you may have to change this a bit to work with your style. These classes also only apply to the forum home page but can easily be modified (by you!) to work on the forumdisplay pages and to work only for certain categories.

Making the browser width small may change things, or if you have long descriptions or sub-forums listed or moderators listed, you may have to change the CSS to accommodate that. As I said, this in ONLY AN OUTLINE of what you need to do. You will have to add styling information yourself.

This is basically what you will end up with:


The very basics of what to do
Add this to the additional.css template - it must be added *after* any other definitions regarding these sub-forums have been declared - if you don't understand why that is, then please read up on exactly what Cascading Style Sheets are all about):

Code:
.forumhead + .childforum .L2:first-child .forumrow, .forumhead + .L2 .forumrow {
  border-top: 0;
}
.forumrow .table {
  height: 100px;
}
ol.childforum {
  float: left;
  width: 100%;
  margin: 0;
  padding: 0;
}
.childforum li.forumbit_post {
  float: left;
  width: 50%;
  margin: 0;
  padding: 0;
  clear:none;
}
#forums .L1 .L2 {
  clear:none;
}
.forumbit_post .forumrow .forumlastpost {
  clear:both;
  width:95%;
}
.forumbit_post .forumlastpost .lastpostby {
  display: block;
  float: left;
}
.forumbit_post .forumlastpost .lastpostdate {
  display: block;
  float: right;
}
.forumbit_post .forumlastpost .lastposttitle {
  display: block;
  float: left;
}
.forumbit_post .foruminfo {
  clear:right;
  float:left;
  min-width:50%;
  width:70%;
}
.forumbit_post .forumstats, .forumbit_post .forumstats_2 {
  width:20%;
}
This same concept can be applied to any list in the style. For instance, you can change the listing of sub-forums under the Sub-Forums listing on the main page also with just a couple of lines:

Code:
.subforums ol.subforumlist  {
  float: left;
  width: 100%;
  margin: 0;
  padding: 0;
}
.subforumlist li.subforum {
  float: left;
  width: 50%;
  margin: 0;
  padding: 0;
  clear:none;
}
/* to remove the commas */
.commalist li.subforum:after {
    content:"";
}
Those lines will get you this (this shows it with commas, add the code under the "to remove the commas" comment and you will not have commas):


Again, this article is NOT about teaching you CSS. You will have to style this yourself and also make any other changes necessarily because of customized styles or changes after beta 4.
Attached Images
File Type: png forum_css5.png (48.8 KB, 0 views)
File Type: png subforum_css1.png (43.9 KB, 0 views)
Reply With Quote
  #182  
Old 11-17-2012, 07:52 AM
Reece^B Reece^B is offline
 
Join Date: Jan 2006
Location: Essex
Posts: 406
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne:

This is in additional.css

PHP Code:
.forumhead + .childforum .L2:first-child .forumrow, .forumhead + .L2 .forumrow {
  
border-top0;
}
.
forumrow .table {
  
height100px;
}
#cat51 ol.childforum {
  
floatleft;
  
width100%;
  
margin0;
  
padding0;
}
.
childforum li.forumbit_post {
  
floatleft;
  
width50%;
  
margin0;
  
padding0;
  
clear:none;
}
#forums .L1 .L2 {
  
clear:none;
}
.
forumbit_post .forumrow .forumlastpost {
  
clear:both;
  
width:95%;
}
.
forumbit_post .forumlastpost .lastpostby {
  
displayblock;
  
floatleft;
}
.
forumbit_post .forumlastpost .lastpostdate {
  
displayblock;
  
floatright;
}
.
forumbit_post .forumlastpost .lastposttitle {
  
displayblock;
  
floatleft;
}
.
forumbit_post .foruminfo {
  
clear:right;
  
float:left;
  
min-width:50%;
  
width:70%;
}
.
forumbit_post .forumstats, .forumbit_post .forumstats_2 {
  
width:20%;
}
.
forumbit_post .forumlastpost .lastposttitle {
  
displayblock;
  
floatleft;
}
.
forumbit_post .foruminfo {
  
clear:right;
  
float:left;
  
min-width:50%;
  
width:70%;
}
.
forumbit_post .forumstats, .forumbit_post .forumstats_2 {
  
width:20%;

Reply With Quote
  #183  
Old 11-18-2012, 03:41 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You would need to add the id tag to all the CSS you want to only apply to that id.

And, you didn't post a link so that we can see the problem.
Reply With Quote
  #184  
Old 11-18-2012, 04:16 PM
Reece^B Reece^B is offline
 
Join Date: Jan 2006
Location: Essex
Posts: 406
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's only the info base I want into columns.
Reply With Quote
  #185  
Old 11-18-2012, 05:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You didn't change it to put the id in front of all that code.

Code:
#cat51 .forumhead + .childforum .L2:first-child .forumrow, #cat51 .forumhead + .L2 .forumrow {
    border-top: 0 none;
}
#cat51 .forumrow .table {
    height: 100px;
}
#cat51 ol.childforum {
    float: left;
    margin: 0;
    padding: 0;
    width: 100%;
}
#cat51 .childforum li.forumbit_post {
    clear: none;
    float: left;
    margin: 0;
    padding: 0;
    width: 50%;
}
#cat51 #forums .L1 .L2 {
    clear: none;
}
#cat51 .forumbit_post .forumrow .forumlastpost {
    clear: both;
    width: 95%;
}
#cat51 .forumbit_post .forumlastpost .lastpostby {
    display: block;
    float: left;
}
#cat51 .forumbit_post .forumlastpost .lastpostdate {
    display: block;
    float: right;
}
#cat51 .forumbit_post .forumlastpost .lastposttitle {
    display: block;
    float: left;
}
#cat51 .forumbit_post .foruminfo {
    clear: right;
    float: left;
    min-width: 50%;
    width: 70%;
}
#cat51 .forumbit_post .forumstats, #cat51 .forumbit_post .forumstats_2 {
    width: 20%;
}
#cat51 .forumbit_post .forumlastpost .lastposttitle {
    display: block;
    float: left;
}
#cat51 .forumbit_post .foruminfo {
    clear: right;
    float: left;
    min-width: 50%;
    width: 70%;
}
#cat51 .forumbit_post .forumstats, #cat51 .forumbit_post .forumstats_2 {
    width: 20%;
}
Reply With Quote
  #186  
Old 11-18-2012, 06:30 PM
Reece^B Reece^B is offline
 
Join Date: Jan 2006
Location: Essex
Posts: 406
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Lynne, it works!

Would you happen to know if I can remove the 'Threads / Posts Last Post' from the top bar of the category name?

Also what CSS would I need to use to make that look like the main site.

Thanks again
Reply With Quote
  #187  
Old 11-19-2012, 03:36 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Reece^B View Post
Thanks Lynne, it works!

Would you happen to know if I can remove the 'Threads / Posts Last Post' from the top bar of the category name?

Also what CSS would I need to use to make that look like the main site. pitbikeclub.co.uk

Thanks again
Just add something like #cat51 .forumthreadpost {display: none;} for the stuff you don't want (do similar for Last Post).

As for formating the blocks, you'll just have to trial and error the CSS for that. firebug is a great tool for that because you can add it right there and see if it works.
Reply With Quote
  #188  
Old 11-20-2012, 07:14 PM
Reece^B Reece^B is offline
 
Join Date: Jan 2006
Location: Essex
Posts: 406
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Lynne, how can I move the titles/subtitles to the right so the image isn't overlapping?

Also is there a way to remove the RSS little logo and the green tick?
Reply With Quote
  #189  
Old 11-20-2012, 09:30 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just something like:
HTML Code:
.forumbit_post .foruminfo .forumdata .datacontainer {
    padding-left: 140px;
    width: 80%;
}
Personally, I'd look into redoing the template for that category. And, I'd set the forums to have a min-width so users can't make their browsers small and 'break' the look. It's not going to be a 2 minute job, it's going to take some effort. And you can remove the RSS logo and green tick just by going what I posted above and setting display to none for that category.

Click on the W3Schools link in my sig for a great site for CSS help.
Reply With Quote
  #190  
Old 11-30-2012, 01:37 PM
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

pls help x columns like this mod: https://vborg.vbsupport.ru/showthread.php?t=99829
Reply With Quote
  #191  
Old 12-01-2012, 11:26 PM
CybertronWizard CybertronWizard is offline
 
Join Date: Nov 2012
Location: Vijawada,AP,India
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks man..Using on my forum...
Reply With Quote
Reply


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 08:26 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.10399 seconds
  • Memory Usage 2,359KB
  • Queries Executed 26 (?)
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
  • (3)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (13)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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