2 sam2kb Jan 11, 2011 22:03Use the following code to check what category you are on, put the code in index.main.php after skin_init( $disp ); call. global $Messages, $cat; if( !empty($cat) && is_numeric($cat) ) { switch($cat) { case 44: // Category with ID 44 $Messages->add('Viewing category #44'); add_css_headline('.bPost { color:red }'); // add custom CSS styles break; case 55: $Messages->add('Viewing category #55'); add_css_headline('.bPost { color:green }'); break; default: $Messages->add('Viewing other categories'); } } else { $Messages->add('Not a category'); } Later in skin you can use this to display conditional HTML global $cat if( !empty($cat) && is_numeric($cat) ) { if( $cat == 567 ) { echo '<p>Some HTML goes here</p>'; } elseif( $cat == 123 ) { echo '<h2>Whatever</h2>'; } }
Use the following code to check what category you are on, put the code in index.main.php after skin_init( $disp ); call.
Later in skin you can use this to display conditional HTML