Go to main content

Textpattern CMS support 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: 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

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

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

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

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: 1,373

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

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

#41 2010-05-28 18:57:58

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

Re: adi_variables - Manage TXP variables

Hi gomedia,

not sure if this question belongs to this thread or to wet_quicklink’s thread, but I’ll begin here. :)

I’m trying to add the magic of wet_quicklink to the adi_variable’s “Write -> Variables” tab.
wet_quicklink’s magic is “just” a bunch of JS/CSS added to the page.

By now, I’ve just added this line:

register_callback('wet_quicklink', 'adi_variables_admin');

on wet_quicklink plugin code.

It “works”: it adds the necessary JS/CSS to “Variables” tab, but that’s being added before <html> element. In other words, it adds invalid, not working, markup.

Not sure where to start to track this down.
I appreciate your help. Thanks.

edit: I forgot to add: this is on TXP 4.0.7.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#42 2010-05-28 22:19:16

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: adi_variables - Manage TXP variables

According to the documentation you link to Julián, wet_quicklink only works for 4.2.0+.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#43 2010-05-28 22:35:10

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

Re: adi_variables - Manage TXP variables

Stu, I’m using and old version of wet_quicklink that was already installed in this website, and so far, it works fine on the Write tab. In fact, I’ve also fixed this old version a little, as it wasn’t working in Chrome.

BTW, now that I recall, you have been modifying adi_variables, right? And you also made your way thru TXP backend code (I really suck on the back-end side of this thing).
Do you have any tip or trick to share in this case?

Thanks, Stu.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#44 2010-05-29 08:47:56

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: adi_variables - Manage TXP variables

Not really I’m afraid Julián. My PHP knowledge is such that I can read the code and understand what it is doing to the point where I can probably modify existing stuff to do what I want but adding or creating new stuff is mostly beyond me. Having said I’m going to have to learn PHP because I’m looking at a completely new plugin to do the same kind of thing but installing the variables as “preferences” so that I have things like “selects” and “radio buttons” available to me but don’t hold your breath. It will take a while. ;)

Why are you trying to combine them?

Last edited by thebombsite (2010-05-29 08:48:50)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#45 2011-03-25 03:11:10

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

Re: adi_variables - Manage TXP variables

Version 0.3 now available, which properly handles single and double quotes in variable values.

The format of the adi_variables form (where the vars & values are stored) has changed again, 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 copy as well. The adi_variables form will be changed to the new format when you do an adi_variable update for the first time.

Upgrading from both 0.1 & 0.2 to version 0.3 is supported.

Offline

Board footer

Powered by FluxBB