Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
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: 999
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: 999
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

#31 2010-02-12 11:46:41

milkshake
Member
From: Linz, Austria
Registered: 2007-06-24
Posts: 80
Website

Re: adi_variables - Manage TXP variables

I would add something to the docs about how to actually output the variables, it was not immediately clear.

Also, you could describe it as site-wide or global custom fields, might help new users grok it.

Thanks for the plugin :)

Offline

#32 2010-02-12 12:33:29

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

Re: adi_variables - Manage TXP variables

milkshake wrote:

I would add something to the docs about how to actually output the variables, it was not immediately clear.

Also, you could describe it as site-wide or global custom fields, might help new users grok it.

Thanks for the plugin :)

Hi William, glad you find adi_variables useful.

Because variables are a built-in feature of Textpattern their usage is probably best left to the official documentation.

Offline

#33 2010-02-12 16:27:46

milkshake
Member
From: Linz, Austria
Registered: 2007-06-24
Posts: 80
Website

Re: adi_variables - Manage TXP variables

True, maybe you could mention that in the docs instead ;)

<txp:variable /> was new to me, been away from txp for a while!

Offline

#34 2010-02-15 14:13:12

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: adi_variables - Manage TXP variables

Hello,

I have a little problem with this plugin.

I made a variable named totpages : <txp:variable name=“totpages” value=“0” />

Then I do this :
<txp:if_different> <txp:variable name=“totpages” value=’<custom_field name=“pagenr”/>’ />
</txp:if_different>

But when i do this :
<txp:output_form form=“adi_variables” />

on any place where on the page no output

What have I done wrong ?

Roelof

Offline

#35 2010-02-15 20:24:32

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

Re: adi_variables - Manage TXP variables

roelof wrote:

I made a variable named totpages : <txp:variable name=“totpages” value=“0” />

Variables for use by adi_variables should be set in the Variables tab under Content. Is this where you set “totpages”?

Then I do this :
<txp:if_different> <txp:variable name=“totpages” value=’<custom_field name=“pagenr”/>’ />
</txp:if_different>

You don’t really need adi_variables if all you’re are doing is using a variable as a counter or flag. In this case just initialise “totpages” where you need to use it.

But when i do this :
<txp:output_form form=“adi_variables” />

on any place where on the page no output

The <txp:output_form> code simply runs a series of <txp:variable> tags from the “adi_variables” form, so it doesn’t generate any output. It should be executed at the top of the page. You can check to see if the “adi_variables” form exists & what it contains. With regards to the <txp:if_different> code above, I can’t really comment on why it is or isn’t working.

Offline

#36 2010-02-15 20:30:57

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: adi_variables - Manage TXP variables

Oke,

Then I have to look for another way to check the values of a variable.
Thank you for the help.

Roelof

Offline

Board footer

Powered by FluxBB