Change heading colour depending on current category

Is there a way to set the colour of the pages heading (H1) depending on the current root category that is selected?

I know where to put the code as I want to put it on a specific wrapper but just not sure what code to use. I may need to number the root categories in order to reference them in case i change them in the future.

Basically, I want to say:

if customer browsing root category 1: use css class ‘blue-heading’

if customer browsing root category 2: use css class ‘green-heading’

if customer browsing root category 3: use css class ‘red-heading’

etc, etc.

so if the customer is in a sub category of root category 2, a green heading would be used for all pages.

Of course, if the customer was viewing something other than products (for example, a content page) a standard heading colour would be used.

Can anyone guide me in the right direction on how to go about doing this?

hi bbrands , diferent design or background , or header colour depending categories is possible.:smiley:

ex colour blue for parent cat + sub cat + product detail of any parent cat+subcat

you must just change the cat id

```php {if $category_data.category_id == ‘38’ || $product.main_category == ‘38’ || $category_data.category_id == ‘57’ || $product.main_category == ‘57’|| $category_data.category_id == ‘58’ || $product.main_category == ‘58’}

{elseif $category_data.category_id == '39' || $product.main_category == '39' || $category_data.category_id == '59' || $product.main_category == '59'|| $category_data.category_id == '60' || $product.main_category == '60'}

{elseif $category_data.category_id == '42' || $product.main_category == '42'}

{elseif $category_data.category_id == '41' || $product.main_category == '41'}

{elseif $category_data.category_id == '40' || $product.main_category == '40'}

{elseif $category_data.category_id == '66' || $product.main_category == '66'}

{/if} ```

hey mototropic

cheers for the reply!

just having a look at the code, is it possible to do it without listing each of the sub-categories IDs?

its just ill need to edit the code each time that i add a sub category.