Textpattern Forum

You are not logged in. Register | Login | Help

#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: 918
Website

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: 645

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: 918
Website

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: 645

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

#37 2010-02-15 20:35:06

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 918
Website

Re: adi_variables - Manage TXP variables

roelof wrote:

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

txp:if_variable> any good to you?

Offline

#38 2010-02-15 20:40:24

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

Re: adi_variables - Manage TXP variables

Hello,

I know that one.
What I mean is that I have to print some variables so I can debug a script im testing now.

Roelof

Offline

#39 2010-02-15 20:50:53

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 918
Website

Re: adi_variables - Manage TXP variables

<txp:php>print_r($GLOBALS['variable']);</txp:php> will print out the values of all variables.

Offline

#40 2010-02-15 20:57:11

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

Re: adi_variables - Manage TXP variables

Hello,

Thank you.
I now can see that the script is not working,
So back to the drawing table.

Roelof

Offline

Board footer

Powered by FluxBB