1
ronvdb
Liquid centered theme
  • 2006/6/19 21:42

  • ronvdb

  • Just popping in

  • Posts: 14

  • Since: 2003/5/21


Hi, i'm developing a centered XOOPS theme without tables (css only).
In some modules i'm only using the center blocks (Newbb), so in that case there are no left or right blocks.
I don't want to give my XOOPS blocks wrappers fixed widths, because that would mean that when there are no left or right blocks there would be empty blocks to the left or right and I would like to give my center block the whole page width.

Anybody have any experiences with a theme like this ? How would my css-layout look like ?

2
leostotch
Re: Liquid centered theme
  • 2006/6/19 22:49

  • leostotch

  • Just popping in

  • Posts: 76

  • Since: 2006/4/1 1


You can test the presence of the left/right columns, and change your columns container class according to this. I did that in my Zeta Reticuli theme:
<{if $xoBlocks.canvas_left and $xoBlocks.canvas_right}>
<{
assign var=columns_layout value='threecolumns-layout'}>
<{elseif 
$xoBlocks.canvas_left}>
<{
assign var=columns_layout value='leftcolumn-layout'}>
<{elseif 
$xoBlocks.canvas_right}>
<{
assign var=columns_layout value='rightcolumn-layout'}>
<{/if}>
<
div class="<{$columns_layout}>">
  .... 
write columns and center as usual ....
</
div>

(please note that this is for 2.0.14, you have to change the name of the variables you test in older versions: $xoBlocks.canvas_left was $xoops_lblocks in 2.0.13, and $xoBlocks.canvas_right was $xoops_rblocks).

Then you can make several CSS rules that ensure the center column is displayed correctly (you won't need the same rules depending on the method you use to get a CSS based layout, but it's for you to get the idea):
#centercolumn {
    
background#fff;
    
padding0px;
}
.
leftcolumn-layout #centercolumn, .threecolumns-layout #centercolumn {
    
padding-left:    170px;
}
.
rightcolumn-layout #centercolumn, .threecolumns-layout #centercolumn {
    
padding-right:        190px;
}

3
ronvdb
Re: Liquid centered theme
  • 2006/6/20 21:01

  • ronvdb

  • Just popping in

  • Posts: 14

  • Since: 2003/5/21


Thanks! i just knew it could be done.

Login

Who's Online

219 user(s) are online (158 user(s) are browsing Support Forums)


Members: 0


Guests: 219


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits