We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47432
    • 48 Posts
    Hi,
    i've just discover clientConfig, and i would like to allow my clients to change colors (as there is a color picker), but the colors are in the css, so i put my css as document, and try to replace the color code by the clientConfig key, but it don't work :-(
    so i suppose it's like TV, we cannot add them inside css
    so what is the best way to do that, copy this css rules in the head ? or there's a better way ?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      How are you using the tags? Can you post a sample line of CSS in your .css resource?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 47432
        • 48 Posts
        here it is:

        .spacer {
        display: block;
        width: 80px;
        height: 3px;
        margin: 15px auto 25px;
        background-color: [[++spacer_color]];
        }

        and i have spacer_color as key in client config
        my resource css, works, i have tested it
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Try it uncached - [[!++spacer_color]]
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 47432
            • 48 Posts
            I have the solution, it was not the uncached
            the color picker don't generate the # only the number, for exemple 000000 instead of #000000 for black
            so i had that: #[[++spacer_color]] and everything works smiley))

            Btw in which case have i to call an element uncached (i have noticed in tutorials sometimes the call is with ! and sometimes without, so i was wondering the meaning of that
              • 4172
              • 5,888 Posts
              I would suggest, call everything cached [[....]] , at first place.
              This will cache the result at the first page-visit.

              Only, if you have parts, which will change from request to request, for example request-parameter-dependent output or randomized output, call this part uncached [[!...]]

              Its possible to create also request-parameter-dependent cached versions of element-output, for example with the getCache - snippet.

                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!