Skip to content
Franco Mussopower pages
Code snippet

CSS made conditional and dynamic

Copy it with the button on the code. For the why and the walkthrough, see “Custom Per-Partner Branding in Power Pages – Part 2: Liquid and CSS”.

CSS made conditional and dynamicLiquid
{%- if user.parentcustomerid -%}
    {%- assign account = entities['account'][user.parentcustomerid.id] -%}
    {%- if account.musdyn_portalbrandingprimarycolour or account.musdyn_portalbrandingsecondarycolour -%}
        <style>
        .navbar.navbar-inverse.navbar-static-top {
            background: {{ account.musdyn_portalbrandingprimarycolour | default: '#000' }} !important;
        }
 
        .navbar-static-top.navbar .menu-bar > .navbar-nav > li > a,
        .navbar-static-top.navbar .menu-bar > .navbar-nav > li > .dropdown-menu > li > a,
        .navbar .navbar-icon span {
            color: {{ account.musdyn_portalbrandingsecondarycolour | default: 'red' }} !important;
        }
        </style>
    {% endif %}
{% endif %}

Search

Book a discovery call

30 minutes. Bring your trickiest Power Pages problem — I’ll tell you honestly whether I’m the right fit.