I need some quick help on a piece of PHP code, if anyone has the time.

I'm writing a theme that has three different sidebars. The top sidebar is 100px wide, each bottom sidebar is 50px wide. The main content area width is a percentage so as some sidebars are rendered or not then the content width would adjust.

I need one css class rendered if there is a top sidebar or both bottom ones, another class if there is only one sidebar, and no class if there are no sidebars.

I need help turning my crappy pidgeon PHP in to queen's PHP?


if ( 
(($sidebar_top) OR (both $sidebar_right AND $sidebar_left))
{print "class1"}

elseif

(($sidebar_left but not $sidebar_right) OR ($sidebar_right but not $sidebar_left)) 
{print "class2" }
)

else
{print ""}


I'll take anything I can get, I am terrible with syntax and profreading. Thanks!

Comments

sherifmayika’s picture

you can use body class or $layout

eg: <div id"<?php print$bodyclass ?>"

css would be automatically renders as"

/*TG content wrapper starts */
#front{

}
#not-front{

}
#logged-in{

}
#not-logged-in{

}
#two-sidebars{

}
#no-sidebars{

}
#sidebar-left{

}
#sidebar-right{

}
#no-sidebars{
	
}
/*visit ThemeGenie.net.  content wrapper ends*/

also sreach drupal 5 theme developers guide

http://dreamweaverdrupalthemeextension.blogspot.com/