Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2009-08-06 11:48:02

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_variables - Manage TXP variables

johnstephens wrote:

Wow! This plugin is great! I have a set of variables that I define for each site, and having an admin-side interface for those is splendid.

Glad you find it useful.

Would you be willing to add support for nested txp:tags? The only change needed would be to have the value string written and read from single quotes ('my value') instead of doubles ("my value").1

A fine suggestion. I’ll look into it.

Offline

#14 2009-08-06 13:15:31

woof
Member
Registered: 2004-08-01
Posts: 128

Re: adi_variables - Manage TXP variables

I also love this plugin and find it really useful – thanks. One small suggestion – how about if there was an option to strip white space, line feeds etc from the output?
In cases where you have many variables, including the <txp:output_form form="adi_variables" /> at the top of the page results in a significant amount of white space in the source. This might appear to be a cosmetic feature suggestion, but I find that when developing sites I’m constantly checking the source to see what’s being output in the <head> and, because of all the line feeds generated by say 20 or more variables I’m having to scroll a lot to do so.

Offline

#15 2009-08-06 13:33:45

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_variables - Manage TXP variables

woof wrote:

I also love this plugin and find it really useful – thanks. One small suggestion – how about if there was an option to strip white space, line feeds etc from the output?

Hello John. I know what you mean, sometimes things go a bit whitespace crazy. It’s not adi_variables that’s doing it (well not directly anyway), the whitespace is probably being generated when the adi_variables form (and others) are parsed by TXP. The website I’m working on at the moment has 12 blank lines before the DOCTYPE definition – and these all come from various forms that are executed at the top of pages.

Offline

#16 2009-08-06 13:41:53

woof
Member
Registered: 2004-08-01
Posts: 128

Re: adi_variables - Manage TXP variables

Ahh yes of course – that makes sense – its caused by the form output, rather than the plugin itself. Since posting I was thinking about it and reckon one way to fix it would be to use a plugin like pat_speeder (only with wraptags so you could selectively use it)

Offline

#17 2009-08-06 14:31:34

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: adi_variables - Manage TXP variables

woof wrote:

I also love this plugin and find it really useful – thanks. One small suggestion – how about if there was an option to strip white space, line feeds etc from the output?
In cases where you have many variables, including the <txp:output_form form="adi_variables" /> at the top of the page results in a significant amount of white space in the source. This might appear to be a cosmetic feature suggestion, but I find that when developing sites I’m constantly checking the source to see what’s being output in the <head> and, because of all the line feeds generated by say 20 or more variables I’m having to scroll a lot to do so.

I’m also a lover of cosmetically beautiful code, and there’s no way to get Textpattern to ignore the carriage returns between variables, even though the parsed variables print nothing. Here’s what I do:

<txp:pax_grep from="'\s|\t|\r|\n'" to=""> <!-- Regular expression that replaces whitespace characters with nothing -->
<txp:output_form form="adi_variables"/>
<txp:output_form form="my_other_variables"/>
</txp:pax_grep>

Hope that helps! pax_grep is available here.

Last edited by johnstephens (2009-08-06 14:32:39)

Offline

#18 2009-08-06 14:40:42

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: adi_variables - Manage TXP variables

gomedia wrote:

“Would you be willing to add support for nested txp:tags? The only change needed would be to have the value string written and read from single quotes ('my value') instead of doubles ("my value").”

A fine suggestion. I’ll look into it.

Thanks! Until then, I’ll keep two separate forms for my site variables, and continue to appreciate this what this great plugin can already do.

Offline

#19 2009-08-06 15:32:56

woof
Member
Registered: 2004-08-01
Posts: 128

Re: adi_variables - Manage TXP variables

johnstephens wrote:

Hope that helps! pax_grep is available here.

Absolutely – many thanks!

Offline

#20 2009-08-10 00:19:12

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_variables - Manage TXP variables

Version 0.2 now available, which copes with TXP tags used in variable values. Thanks to John Stephens for the suggestion.

The format of the adi_variables form (where the vars & values are stored) has changed slightly, so I would recommend doing a backup before upgrading the plugin – you can use the Backup option in the adi_variables Admin tab to do this but take the “belt & braces” approach and do a manual backup as well.

Offline

#21 2009-08-10 00:50:04

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: adi_variables - Manage TXP variables

Cheers!

Offline

#22 2009-09-02 11:20:50

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: adi_variables - Manage TXP variables

Any chance of a fix for the errors in 4.0.2 now that it’s been released?

Thanks :)

Offline

#23 2009-09-02 11:46:45

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_variables - Manage TXP variables

FireFusion wrote:

Any chance of a fix for the errors in 4.0.2 now that it’s been released?

I’ve just realised what you’re seeing – it’s my own debug info! Have you edited the plugin to set $debug to be TRUE?

Offline

#24 2009-09-02 14:13:02

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

Re: adi_variables - Manage TXP variables

Hi Adi, hi adi_variable users,

a few comments and thoughts before they sink in the deep /dev/null of my head.

*) adi_variables and cnk_versioning can’t be seamlessly combined/streamlined in the same workflow. Of course, you can try to use both and be cautious on how you set up things, but you take the chance of stepping over the adi_variables on the database side (where end users already stored their variables). Two possible solutions that come to my mind: a) hack cnk h_versioning to ignore adi_variables form. b) move adi_variables form out of txp_forms

*) Adi, being that txp:variable can be used as a wrapping tag to define its value, what do you think about having not just input fields but also textarea fields?

*) now that there txp:scope is in the pipeline, things may begin to get complicated :)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB