Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Central storage for site-wide constants: Helpful?
wet wrote:
Frankly, this is a hmm… awkward… concept. I wouldn’t want to count the support threads and bug fixes stemming from such an implementation. Databases are made to handle name/value pairs quite reasonably.
Ah, ok.
I thought the idea was to not leave traces on the database, and that made me think this awkward idea about a created-on-the-fly manager for variable values.
Last edited by maniqui (2008-05-28 15:39:01)
Offline
Re: Central storage for site-wide constants: Helpful?
Related but off topic…
Parsing css and inserting site-wide constants would be awesomely powerful. I imagine that parsing css slow things down quite a bit, but if you use some kind of css-caching ala rvm_css this would be alleviated after the initial build of a site.
Colors, margins, paddings floats, even entire methods could be modularized this way…
Thoughts?
Offline
Re: Central storage for site-wide constants: Helpful?
rvm_css does static caching, because CSS is exactly that: static. If you parse CSS it’s no longer static. The only way to find the correct CSS would be to parse it and that has to happen when fetching the CSS.
Offline
Re: Central storage for site-wide constants: Helpful?
But it could do a little parsing during the ‘save’ event. Endless possibilities ;-)
Offline
Re: Central storage for site-wide constants: Helpful?
Yep, I had pictured it the way Wet described it. When you save the css it parses some nice little variable-ish constants. Then it is served up as static.
Offline
Re: Central storage for site-wide constants: Helpful?
Shaun Inman has already done all the hard thinking.
Offline
Re: Central storage for site-wide constants: Helpful?
That’s exactly what I was thinking of.
Shoving is the answer – pusher robot
Offline
Re: Central storage for site-wide constants: Helpful?
Offline
Offline
Re: Central storage for site-wide constants: Helpful?
Last edited by iblastoff (2008-07-02 10:18:07)
Offline
Re: Central storage for site-wide constants: Helpful?
Yes wet, very useful for those that don’t do stripes in jQuery.
In the same vein… untested but should work if I’ve understood the syntax:
<txp:variable name="plural" value='<txp:comments_count />' />
<p>
<txp:comments_count /> comment<txp:if_variable name="plural" value="1"/><txp:else />s</txp:if_variable> so far.
</p>
Last edited by Bloke (2008-07-02 10:23:37)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Central storage for site-wide constants: Helpful?
iblastoff wrote:
I think the original base is the Registry Pattern. At least, this is what I had in mind.
Offline