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
  #162  
Old 07-25-2012, 03:53 AM
Dr Aj642's Avatar
Dr Aj642 Dr Aj642 is offline
 
Join Date: Apr 2009
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

As I said, I need a link to the site/style in order to view the problem. I like to use firebug for CSS issues and I can't do that without a link to the site/style.
Reply With Quote
  #164  
Old 07-30-2012, 05:40 PM
tommythejoat's Avatar
tommythejoat tommythejoat is offline
 
Join Date: Apr 2008
Location: Boston
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Ah, I see what you mean. You said it differed from forum to forum and I thought you meant looking at one forum page (forumdisplay) versus another (cuz if you have subforums on those pages, then the code will align them on those pages also).

If you look at the page using firebug, you'll see that the width given to each of the <li> is different. You need to do something to set those to 100%. You'll have to play with it a bit cuz lists are a bit odd with CSS.
This response sf from a while ago, but I had some time today to look at it again and I remain confused about what is going on. I examined several of the li tags with FireBug and they all are pretty much the same. Where would I find the width you are referring to above?

Here is what the code looks like.

html:
HTML Code:
<li class="subforum">
<img id="forum_statusicon_291" class="inlineimg" border="0" alt="" src="images/statusicon/subforum_old-48.png">
<a href="forumdisplay.php?291-Moderator-Procedures-and-Training-Project">Moderator Procedures and Training Project</a>
</li>
css:
Code:
.subforums ol.subforumlist {
    float: left;
    margin: 0;
    padding: 0;
    width: 100%;
}
.subforumlist li.subforum {
    clear: none;
    float: left;
    margin: 0;
    padding: 0;
    width: 50%;
}
The css looks just like your example to me but there does not seem to be any width control. I suppose it is possible that the containers have different widths, but visibly they are the same for each of the categories.
Reply With Quote
  #165  
Old 08-06-2012, 07:54 AM
Dr Aj642's Avatar
Dr Aj642 Dr Aj642 is offline
 
Join Date: Apr 2009
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
As I said, I need a link to the site/style in order to view the problem. I like to use firebug for CSS issues and I can't do that without a link to the site/style.
Ok, here it is.

http://abasketballjones.com/forum/forum.php?styleid=3

Hope that helps.

Cheers Lynne
Reply With Quote
  #166  
Old 08-06-2012, 04:03 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 Dr Aj642 View Post
Ok, here it is.

http://abasketballjones.com/forum/forum.php?styleid=3

Hope that helps.

Cheers Lynne
You should increase the min-height for ".forumbit_nopost .forumbit_nopost .forumrow, .forumbit_post .forumrow" to something like 100px or so and see if that fixes it.
Reply With Quote
  #167  
Old 08-07-2012, 05:40 AM
Dr Aj642's Avatar
Dr Aj642 Dr Aj642 is offline
 
Join Date: Apr 2009
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
You should increase the min-height for ".forumbit_nopost .forumbit_nopost .forumrow, .forumbit_post .forumrow" to something like 100px or so and see if that fixes it.
Still the same

Strange how it hasn't evenly split them 15 on the left and 15 on the right...

Someone has created a mod that splits categories which is exactly what i want, but bad thing is, the mod hasn't been updated so you can't choose which one you want split...

dammit
Reply With Quote
  #168  
Old 08-14-2012, 12:36 AM
ArsMagnum ArsMagnum is offline
 
Join Date: Apr 2012
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm on the same situation, so i'm trying to play with the codes to see if it fixes. And the problem is in the same side of the category, so there must be something on it or... something.
If I get to fix it earlier I'll let you know :P
Reply With Quote
  #169  
Old 08-14-2012, 01:03 AM
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 Dr Aj642 View Post
Still the same

Strange how it hasn't evenly split them 15 on the left and 15 on the right...

Someone has created a mod that splits categories which is exactly what i want, but bad thing is, the mod hasn't been updated so you can't choose which one you want split...

dammit
I still see the min-height set at 58px.

When I change it using firebug, the site looks fine.
Reply With Quote
  #170  
Old 08-14-2012, 02:26 AM
ArsMagnum ArsMagnum is offline
 
Join Date: Apr 2012
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne, i had the same problem as Dr Aj but I could fix it with that you said, but another issue came right after that one.

On the left side, the last forum looks like... deeper from the other ones, I dont really know how to describe it.
Here, I leave you the link so you can check it by yourselve:

http://forum.arsmagnum.com/forum.php

it is at the "Anime & Manga" Category.

Plus... Is there anyway that I can change that option of min-heigh only in one category? I've been trying but I dont know how
Reply With Quote
  #171  
Old 08-14-2012, 03:58 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 ArsMagnum View Post
Hi Lynne, i had the same problem as Dr Aj but I could fix it with that you said, but another issue came right after that one.

On the left side, the last forum looks like... deeper from the other ones, I dont really know how to describe it.
Here, I leave you the link so you can check it by yourselve:

http://forum.arsmagnum.com/forum.php

it is at the "Anime & Manga" Category.

Plus... Is there anyway that I can change that option of min-heigh only in one category? I've been trying but I dont know how
You have your min-height set to 95px, I think it needs to be larger. If you only want it for that one category, then use the category id:

#c_cat18 .forumbit_nopost .forumbit_nopost .forumrow, #c_cat18 .forumbit_post .forumrow {min-height: 105px;}
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:01 PM.


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.05141 seconds
  • Memory Usage 2,358KB
  • 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
  • (6)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