Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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: 1,000
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: 1,000
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: 1,000
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

#25 2009-09-02 15:11:48

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

Re: adi_variables - Manage TXP variables

*) 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?

Whether or not you include textarea fields, outputting the txp:variables as enclosing tags is pretty compelling— it can enclose strings, txp:tags and anything else. This might be a better way to allow Textpattern tags in the variables than what I recommended earlier with the single quotes.

adi_variables and cnk_versioning can’t be seamlessly combined/streamlined in the same workflow.

I use cnk_versioning on every project, and I admit that it took me a minute to figure out why adi_variables wasn’t saving. My solution is to only edit adi_variables when the site’s production status is set to “Live”, since cnk_versioning does not reload templates when the site is live. Then export any changes to the file using cnk_versioning’s function. This is only an issue during development, since I don’t leave cnk_versioning enabled when I hand over a site to clients.

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

I would only use adi_variables for variables intented for universal scope.

Offline

#26 2009-09-03 23:04:27

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

Re: adi_variables - Manage TXP variables

Hi Julián & John,

Thanks for the thoughts & suggestions.

WRT adi_variables using a form to store variables & values – there was no particular reason for this other than it seemed like a good idea at the time. I have subsequently wondered why I didn’t use a database table – if it would help fix compatibility issues I’d be happy to oblige.

The input fields could easily be textareas. I can see how it would make life a little easier when specifying more complicated values.

<txp:scope /> is an interesting development. I think adi_variables is really only intended for variables in the global scope, so I think I’m off the hook. However, I’m always open to persuasion!

Cheers,

Adi

Offline

#27 2009-09-04 01:31:06

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

Re: adi_variables - Manage TXP variables

Thanks, Adi! I like keeping the variables in a form, since I use cnk_versioning to keep all my templates in the file-system, which allows me to quickly build new sites with existing design patterns. It was confusing when I first turned the plugin on and jumped right in, but when I read the help file, it was easy to see how it worked and how to make the best use of it.

Offline

#28 2009-09-30 18:51:00

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

Re: adi_variables - Manage TXP variables

Does this very useful plugin work with 4.2 yet?

Offline

#29 2009-09-30 20:04:23

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

Re: adi_variables - Manage TXP variables

I’m using this plugin on two sites that recently upgraded to 4.2.0, and I haven’t noticed any problems. No problems on 4.0.8, neither while testing the 4.2.0 release candidate, nor since upgrading to 4.2.0.

My experience with Textpattern development suggests that the developers make every reasonable effort to make sure plugins don’t break with upgrades, and that plugins with active developers work with the latest version by default. Plugins that fail on an upgrade are a rare exception.

Do you have specific issues that you are trying to troubleshoot?

Offline

#30 2009-10-01 00:04:16

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

Re: adi_variables - Manage TXP variables

FireFusion wrote:

Does this very useful plugin work with 4.2 yet?

It still works with 4.2.0. Did you see my previous reply?

Offline

Board footer

Powered by FluxBB