PDA

View Full Version : Sideblock scrollbars


RobDog888
05-24-2011, 03:03 PM
I want to have one of my sideblocks list many items but dont want it to be a whole page tall lol. So Im sure it has to be done with a DIV and an overflow or something. Anyone know the code?

Thanks

Lynne
05-24-2011, 03:37 PM
The sideblock should just be the height that is needed to display what you want. Why not make sure you are only spitting out xx amount of content and then you don't have to worry about scrollbars. But, if you want a scrollbar, then yes, it is the overflow property for the div - http://www.w3schools.com/Css/pr_pos_overflow.asp

RobDog888
05-24-2011, 03:44 PM
Thanks Lynne but members want to see like 10+ New Forum Posts and its too long. How could I force it to 5 posts high but contain 10-20 posts?

There is no code for the default New Forum Posts block

Lynne
05-24-2011, 03:49 PM
Then modify the template? Or, create your own template and use it instead?

RobDog888
05-24-2011, 04:07 PM
Do I modify the content_container one?

--------------- Added 1306298037 at 1306298037 ---------------

Got it. Modified the template for new posts and inserted a div with the auto setting for overflow so it only shows th scrollbar when needed

<div class="widget_content blockbody floatcontainer">
<div style="height: 325px; overflow: auto;">


--------------- Added 1306301969 at 1306301969 ---------------

Made it cleaner with these template edits:

block_newposts:

<div class="widget_content blockbody floatcontainer sidebarsidescrollbar">


additional.css:
/* SIDEBAR SCROLLBAR FOR LIMITING THE HEIGHT TO 300PX */
.sidebarsidescrollbar {
height: 300px;
overflow: scroll;
}