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. |
#192
|
|||
|
|||
Awesome Lynne!
I still get the comma in my subforum list though even after I added in: .commalist li.subforum:after { content:""; } Edit: Nevermind Thanks again. |
#193
|
|||
|
|||
I stuffed in the code in the additional css and it works better than last time I try it. I was on 4.1.2 now on 4.1.2 pl8.
So to make the double column affect just one category just add the line with the cat number edited in? Just that simple? |
#194
|
||||
|
||||
Yep, just add the catid.
|
#195
|
|||
|
|||
Does anyone know how to adjust height?
|
#196
|
||||
|
||||
You would use the height property (which is shown in many of the CSS rules).
|
#197
|
|||
|
|||
My current code is:
Code:
#cat51 .forumhead + .childforum .L2:first-child .forumrow, #cat51 .forumhead + .L2 .forumrow { border-top: 0 none; height:100px; } #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%; height:100px; } #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%; height:100px; } #cat51 .forumthreadpost {display: none;} #cat51 .forumlastpost {display: none;} #cat51 .forumactionlinks {display: none;} #cat51 .forumbit_post .foruminfo .forumdata .datacontainer { padding-left: 140px; width: 80%; } However if you see the screen attached the columns aren't evenly spaced. How do I do this?! I keep trying to no avil. |
#198
|
||||
|
||||
You have some which naturally want to be taller than 100px. So, you need to pick something larger, like 120px to make them all the same height. Or, you need to set the overflow to hidden, but then some text may disappear.
|
#199
|
|||
|
|||
How can I move that text so it's not over lapping?
|
#200
|
|||
|
|||
Is anyone using this on 4.2.1 ?
|
#201
|
|||
|
|||
yes
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|