XF 1.5 Different navbar color based on actual page


I'd like to know how to set a different color to the navbar based on the page i'm browsing. Actually this is for XenPorta but should be useful for custom pages too.

As XenPorta layouts css aren't global, they just affect to it section, you can't just set the #userBar .navTabs inside it and expect it changing, it must be done on a global one (EXTRA.css?).
But i'm not really sure about the condition it must have on the css to be only shown on each different template (i'm using many subportals, each one with a custom template (EWRporta_Portal_xxx) and i'd like to color the navbar with a different color on each page.

EDIT : I've been digging and $contentTemplate seems perfect to this. However, my custom templates return a NULL $contentTemplate (dumped it to check), so how can i set it to a custom value?

Last edited:

Any solution would be appreciated, even setting a different primaryColor on each template would work.

EDIT: Can be closed. Finally figured out a solution.
Last edited: