The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[HOW TO - vB4] Two column forum/sub-forum setup via CSS only
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%; } 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:""; } 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. |
#72
|
|||
|
|||
I have tried but not been
|
#73
|
|||
|
|||
Lynne has been extremely helpful in this thread with CSS debugging, but please realize that each forum is different based on what specific styles you are using, so small edits to Lynne's CSS that work for one forum may not work as well for another.
I do recommend that you follow her advice and download either Firebug or the Web Developer plugin for Firefox. Using the Web Developer plugin, you can edit CSS "on-the-fly" to see what certain CSS changes look like instantly on your website without changing any code in the admincp. Once you find the CSS combination you like, just copy the code from Web Developer and apply it to your CSS files. Besides being an excellent tool (that does much, much more then just edit CSS) it helps you learn by doing. You see instantly what your file edits do and how fun it can be to style your website on your own. Again, thank you for this great tutorial Lynne. |
#74
|
|||
|
|||
hi.. its working fine with firefox but in internet explorer it is displaying in only one columns. I had pasted the code in forumbits-ie.css also. www.penmai.com/forums
|
#75
|
||||
|
||||
I jsut looked at your site and don't see any of this CSS being used. Make sure you put it in the additional.css template.
|
#76
|
||||
|
||||
Does this work on forumdisplay.php ?
|
#77
|
||||
|
||||
The basic CSS will work on the forumdisplay, yes. However, you may need to change some class or id names. (There is also a modification that will do this.)
|
#78
|
|||
|
|||
Thanks Lynne, it worked perfectly.
|
#79
|
|||
|
|||
Brilliant little top-tip this article of yours, thanks for sharing it.
I hope you don't mind me posting a possible solution Lynne. This seems to be working for my site, I added this to the additional.css Code:
div.forumbit_post { float: left; width: 100%; margin: 0; padding: 0; clear:none; } .forumbit_post { float: left; width: 50%; margin: 0; padding: 0; clear:none; } |
#80
|
|||
|
|||
Hmmm, something is wrong with the snippet I posted above, every now and then one of the sub-forums gets moved over somehow so an empty space appears. You can see it occurring here: http://styleorigin.com/community/for...-Mental-Health
It's only every now and then, if I refresh the page a few times it seems to right itself, obviously there's something wrong or it wouldn't dropdown. |
#81
|
||||
|
||||
Yes, I was just browsing your site, before I read your last post. I noticed that.
Does anyone know what's causing Alice's bug with sub-forums display? What would the code be to display 3 columns? Same but 0%, 33% and 66% ? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|