Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2008-05-28 13:40:04

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#26 2008-05-28 15:29:45

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

#27 2008-05-28 17:23:16

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#28 2008-05-28 17:26:37

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Central storage for site-wide constants: Helpful?

But it could do a little parsing during the ‘save’ event. Endless possibilities ;-)

Offline

#29 2008-05-28 18:13:18

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

#30 2008-05-28 18:17:23

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Central storage for site-wide constants: Helpful?

Shaun Inman has already done all the hard thinking.

Offline

#31 2008-05-28 19:21:24

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Central storage for site-wide constants: Helpful?

That’s exactly what I was thinking of.


Shoving is the answer – pusher robot

Offline

#32 2008-07-02 04:50:36

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Central storage for site-wide constants: Helpful?

Offline

#33 2008-07-02 10:06:16

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: Central storage for site-wide constants: Helpful?

Brilliant! So many possibilities…


BB6 Band My band
Gud One My blog

Offline

#34 2008-07-02 10:17:58

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: Central storage for site-wide constants: Helpful?

so is it basically this idea?

Last edited by iblastoff (2008-07-02 10:18:07)

Offline

#35 2008-07-02 10:22:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,467
Website GitHub

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

#36 2008-07-02 10:25:20

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Central storage for site-wide constants: Helpful?

iblastoff wrote:

so is it basically this idea?

I think the original base is the Registry Pattern. At least, this is what I had in mind.

Offline

Board footer

Powered by FluxBB