[pmwiki-users] floating box on the right

Joachim Durchholz jo at durchholz.org
Tue Mar 22 15:26:07 CST 2005


Patrick Ogay wrote:

> I like to display on certain sites some information in a "newsbox", 
> which should be a floating box on the right oder a RightSidebar
> Is there an easy way to display such a box in standard template?  Or in 
> the Content?
> 
> A feature like this I would appreciate much.

I just extended the beeblebrox-netgila2 skin with that feature, simply 
by copying the appropriate parts in the css and tmpl, and consistently 
renaming "left" to "right".

Traps I fell to:

1) Not all occurrences of "left" should be replaced. Those that should 
are the names of the CSS classes and any left and right border 
attributes. Most left-margin etc. attributes are for formatting the 
header lines within the sidebar.

2) In a CSS-based design, the right bar must come *before* the main area 
(i.e. immediately following the left sidebar). This is because that's 
the way how float boxes work: their contents is layouted, then the 
entire box is shifted to the left resp. right, leaving room for the 
remaining text to float around to the right resp. left. (This 
layout-first-shift-later approach is also why it's necessary to give a 
fixed width to the sidebars: otherwise, the browser will simply layout 
the lines to eat up all the horizontal space. A table-based layout can 
adjust the sidebar widths to their respective contents, though I have 
encountered problems there, too.)

3) The main block must have enough left and right margins to accommodate 
the widths of the left and right sidebars, respectively.
I.e. if the left sidebar says "width: 10em" and the right sidebar says 
"width: 15em", the main block must say "left-margin: 10em; right-margin: 
15em". (Having a wider margin will simply leave more white space between 
sidebars and main body. Having a smaller margin will push the main body 
below the sidebar.)

HTH.
Jo



More information about the pmwiki-users mailing list