“Customizable template option variables”
Posted: Tue Jul 23, 2013 7:35 pm
So I came up with another weird thing for which I don't have a name yet which would in my opinion make for an awesome feature in S9y. You guys all know the drill, right? First I explain this in a clumsy, elaborate, extensive manner, and then Garvin goes: “Oh, we already have that.”
Here's what I'd love to have:
Our style.css is being “parsed” (or whatever you crazy PHP guys call it) by serendipity.css.php. Among other magical things, this process substitutes {TEMPLATE_PATH} by the actual path to the templates directory, making it possible to reference CSS assets like background images properly.
What if there were other template-based variables like this which would also be parsed there?
Example: in a template's theme options, I could have an option “Primary color” which would contain a corresponding input field with the default value of, say, #ff0000. But users could change this to, say, #0000ff, because nobody really likes red anyway, right? Blue is much cooler. And what if in the style.css the template author could use something like
and serendipity.css.php (or the template's config.inc.php or whatever) would just replace that by whatever value a corresponding theme option would hold?
That way, users could very easily tweak templates to their liking without having to edit code or having to use a user.css. (And I would never have to write a user.css generator like the one for 2k11 again, which would be super awesome, because seriously, that was a major pain in the ass.) And I can think of some more things to do with this …
Is this doable, reasonable, does it even make sense? Anybody up for this?
YL
Here's what I'd love to have:
Our style.css is being “parsed” (or whatever you crazy PHP guys call it) by serendipity.css.php. Among other magical things, this process substitutes {TEMPLATE_PATH} by the actual path to the templates directory, making it possible to reference CSS assets like background images properly.
What if there were other template-based variables like this which would also be parsed there?
Example: in a template's theme options, I could have an option “Primary color” which would contain a corresponding input field with the default value of, say, #ff0000. But users could change this to, say, #0000ff, because nobody really likes red anyway, right? Blue is much cooler. And what if in the style.css the template author could use something like
Code: Select all
a,
a:visited {
color: {PRIMARY_COLOR};
}
That way, users could very easily tweak templates to their liking without having to edit code or having to use a user.css. (And I would never have to write a user.css generator like the one for 2k11 again, which would be super awesome, because seriously, that was a major pain in the ass.) And I can think of some more things to do with this …
Is this doable, reasonable, does it even make sense? Anybody up for this?
YL