0

Fetch Company Properties in CSS

It would be super cool if we could fetch value from Company Properties in the CSS file. Then we could have one master CSS and only modify minor adjustment for each Client, e.g. color of the heading.

I tried by adding the Company Property "ccstest" with the same value. Then I included this in the CSS file: {props.csstest}. It didn't work. It there an other way? Other wise, it would be great if it was added.

4 comments

  • 1
    Avatar
    Josh Cohen-Collier

    Hi Jon,

     

    Thanks for posting in our community!

    While CSS itself cannot deal with variables, if you are using our Custom Theme Addon, this comes with the ability to upload custom Javascript, which can grab Klipfolio variable values.
    You will need to use the dashboard.getDashboardProp Javascript function.
    The function has the following format.

    • Variable name
    • Scope(1=Klip,2=Dashboard,3=All Dashboards, 4=Company/User)
    • ID of Tab to apply in

    So, to get the value of a company property in the current tab, you can use the following line.
    Just make sure to put your own variable name in the first parameter.

    dashboard.getDashboardProp("company.YOUR_VARIABLE_HERE",4,dashboard.activeTab.id);


    Hope this helps!

    Best regards,
    Joshua

  • 0
    Avatar
    Jon S

    Hi Joshua,

    That setup worked amazingly well. Now we can use one parent CSS template and let each client make some minor and specific changes using their Company Properties. Thanks!

    But it would be even more amazing if each client could toggle between the light and dark CSS base template using the Company Properties.

    I.e: Is it possible to toggle each client between light and dark CSS base template using the Javascript, ignoring the setting in the parent CSS in the master account?

     

    Kindest regards from Stockholm,

    Jon

  • 0
    Avatar
    Josh Cohen-Collier

    Hi Jon,

    Glad to hear!

    Unfortunately, there is no way at the moment to do this with CSS, other than recreating the custom code, and modifying it in the way you want.
    However, you can accomplish this by setting the client to not use any custom CSS.
    Then, log into the account as an Admin via the Clients console, and manually change the theme yourself.

    Now, since only a user with Admin permissions can change the theme being used, and each theme is tracked individually, if you make it so that the client account has no users that are able to change the theme, you can set each client account to use the Black/White theme without having to use CSS.

    Let me know if you need clarification on anything.

    Best regards,
    Joshua
    __________
    Technical Support Specialist, Klipfolio

  • 0
    Avatar
    Jon S

    Hi Josh,
    Did you mean that we should not use the custom CSS at all, and toggle between the light and dark original Klipfolio CSS? If not, I did not really follow you.

    We want to set a parent CSS that each client use as "parent". As for now, we can edit some parts of the CSS with their company properties.

    On a client level our CSS is adjusted depending on the the chosen base template. But this is not possible when we use a parent CSS.

    Can we still use custom CSS on a parent level and choose between light and dar base template for each client? If so, I did not really follow you. :)

Please sign in to leave a comment.