[ic] if explicit problem with data tag

Daniel Browning db at endpoint.com
Sat Nov 21 20:28:16 UTC 2009

On Saturday 21 November 2009 11:36:56 am Rick Bragg wrote:
> [if type=explicit compare="$Tag->data({ table => groups
>     column => description,  key => [data session arg], })"] ...
> Any ideas what the problem is?  

Here is what I suggest as a replacement:

[if type=data term="groups::description::[data session arg]"]

If you're curious why the first version didn't work, there are several 
reasons. When you pass perl to a usertag, it helps to try executing that 
perl by itself first to check for problems, like so:

    return $Tag->data(
            table => groups 
            column => description, 
            key => [data session arg], 

That will show you the syntax errors (missing comma, unquoted literals, 
table access). Here is the fixed code:

[perl tables="groups"]
    return $Tag->data(
            table => 'groups',
            column => 'description', 
            key => q{[data session arg]}, 

Then you could package that up and put it back in the compare="" clause, if 
you could not use this shorter version for some reason:

[if type=data term="groups::description::[data session arg]"]

Daniel Browning
End Point Corporation

More information about the interchange-users mailing list