I actually had a similar task a few weeks ago and I solved it with the client-config extra and a little plugin I wrote.
Basically I use the Clientconfig CMP to set the desired css colors (or whatever, think of a very primitive SASS/LESS preprocessor...) so they get available as for example [[++css.color.main]].
I want these to get processed in a static css file (not a resource bc I don't like to have css-resources...or any css/js in the modx db at all...I want to have these outside of the manager as "normal" static files, nicely organized in a folder =D) so that's where the plugin comes in. It's attached to this post.
Steps to setup:
1. Download and install clientconfig from the packagemanager
2. Make a group and a setting like css.color.main, give it a color code like #FF0000, orange, rgb(0,0,0) or whatever is accepted as a value for that css rule...
3. Create a new plugin with the code from the attached file in it, activate it on the system events "OnBeforeCacheUpdate" and "OnHandleRequest".
For the OnHandleRequest event you need to set the priority (last field in the grid) to 100 for example, because clientconfig also runs on that event and the plugin needs to run after it...
4. You can create two new system settings called "
processstatix.paths" and "
processstatix.extension" (these could also be set in clientconfig, whatever you prefer). By default the paths are "assets/site/css/" and "assets/site/js/", you can provide a comma separated list of paths where the plugin should look for files with the extension specified in "processstatix.extension" which is by default "process" but you can set it to whatever you like, just be sure that the files that should be processed have that extension AND the real extension...see next point.
5. go to your path, for example "assets/site/css/" and create a new file there with let's say the name "
base.colors.css.process", add some rule like:
div.main {
color: [[++css.color.main]];
}
6. clear the cache and reload the page (frontend)
7. go to your assets/site/css/ folder and there should be a new file "base.colors.css" which has the placeholder parsed with the value you set in clientconfig...
Annotation: This isn't limited to css, you can process ANY kind of static files (css,js,json whatever) with MODx tags in it (it's also not limited to system settings, you can use whatever MODx tags that are available, but as susan said, TV's are resource specific, so a system setting would may be a better place to set things like css colors...)...I actually didn't test it with TVs, but it should work, and if not, tell me =D
EDIT: And you should set the $debug variable to "false" or you will have quite some spam inside your error log =D...I can't remove the first attachment, so you have to change this yourself when pasting in the code...
[ed. note: exside last edited this post 13 years, 6 months ago.]