# How do I assign an alternative style.css according to a category?

**URL:** <https://forum.oxid-esales.com/t/how-do-i-assign-an-alternative-style-css-according-to-a-category/51035>\
**Category:** English forums\
**Tags:** basics\
**Created:** [July 5, 2011, 5:02pm UTC](https://forum.oxid-esales.com/t/how-do-i-assign-an-alternative-style-css-according-to-a-category/51035 "2011-07-05T17:02:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![breezemaster](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@breezemaster](https://forum.oxid-esales.com/u/breezemaster)\
**Post date:** [July 5, 2011, 5:02pm UTC](https://forum.oxid-esales.com/t/how-do-i-assign-an-alternative-style-css-according-to-a-category/51035/1 "2011-07-05T17:02:13Z")

</div>

Hi.

I’d like to switch to alternative style themes depending on the category chosen.  
I’ve seen some reference to this in the German forums, but I can’t understand good enough to implement it.

Could someone please enlighten me?

---

<div class="post-metadata">

**Author:** ![leofonic](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/leofonic/32/58_2.png) [@leofonic](https://forum.oxid-esales.com/u/leofonic)\
**Post date:** [July 6, 2011, 3:01am UTC](https://forum.oxid-esales.com/t/how-do-i-assign-an-alternative-style-css-according-to-a-category/51035/2 "2011-07-06T03:01:37Z")

</div>

This is Code for \_header.tpl (or base.tpl), you can change the OXID of the category and the name of the css-File:

```auto

[{assign var="actCategory" value=$oView->getActiveCategory()}]
[{assign var="rootCategory" value=$actCategory->oxcategories__oxrootid->value}]
[{if $rootCategory=='30e44ab83fdee7564.23264141'}]
    <link rel="stylesheet" type="text/css" href="[{ $oViewConf->getResourceUrl() }]blue.css">
[{/if}]

```

---

<div class="post-metadata">

**Author:** ![breezemaster](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@breezemaster](https://forum.oxid-esales.com/u/breezemaster)\
**Post date:** [July 6, 2011, 3:14pm UTC](https://forum.oxid-esales.com/t/how-do-i-assign-an-alternative-style-css-according-to-a-category/51035/3 "2011-07-06T15:14:06Z")

</div>

Hi and thanks for the help so far.

I’m still missing some fundamental info though I think.

How do I define the categories that would adopt blue.css?  
I see you’ve got:

```auto
$rootCategory=='30e44ab83fdee7564.23264141

```

but I can’t see where you got this ID from.

To expand on the same question. How could I add unique css styles to the check-out and the product detail page?

Many thanks!

---

<div class="post-metadata">

**Author:** ![Hebsacker](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/hebsacker/32/45_2.png) [@Hebsacker](https://forum.oxid-esales.com/u/Hebsacker)\
**Post date:** [July 6, 2011, 3:24pm UTC](https://forum.oxid-esales.com/t/how-do-i-assign-an-alternative-style-css-according-to-a-category/51035/4 "2011-07-06T15:24:47Z")

</div>

This is the OXID of the root category - you´ll find it inside the database

---

<div class="post-metadata">

**Author:** ![leofonic](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/leofonic/32/58_2.png) [@leofonic](https://forum.oxid-esales.com/u/leofonic)\
**Post date:** [July 6, 2011, 3:30pm UTC](https://forum.oxid-esales.com/t/how-do-i-assign-an-alternative-style-css-according-to-a-category/51035/5 "2011-07-06T15:30:02Z")

</div>

The ID is the OXID field of the category, you can find it in PHPmyadmin if you search the category in oxcategories table.

Details page:

```auto

[{if $oView->getClassName() == "details"}]
    <link rel="stylesheet" type="text/css" href="[{ $oViewConf->getResourceUrl() }]blue.css">
[{/if}]

```

Checkout:

```auto
[{if $oView->getIsOrderStep()}]
    <link rel="stylesheet" type="text/css" href="[{ $oViewConf->getResourceUrl() }]blue.css">
[{/if}]

```

---

<div class="post-metadata">

**Author:** ![system](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/system/32/4245_2.png) [@system](https://forum.oxid-esales.com/u/system)\
**Post date:** [July 13, 2026, 7:38pm UTC](https://forum.oxid-esales.com/t/how-do-i-assign-an-alternative-style-css-according-to-a-category/51035/6 "2026-07-13T19:38:37Z")

</div>

Closed on July 13, 2026, 7:38pm UTC


