Gossamer Forum
Home : Products : Gossamer Links : Discussions :

I Need Parents

Quote Reply
I Need Parents
I have created a template global called get_parents:
Code:

sub { # Get the parents of an ID
my $category_id = shift;
my $category = $DB->table('Category');
my $parents = $category->parents ( $category_id );
return $parents;
}

In the template I call this sub-routine as <%set data=get_parents(84)%>

A dump of the returned data is: (why the backslash '\' ?)

\[
'3',
'396',
'64'
]

The parent id numbers being returned are correct. But, I can't access them in the template. I have tried:

<% data %>
<% $data %>
<% data[0] %>
<% $data[0] %>
<% @data[0] %>
<% @$data[0] %>

Please tell me what I'm doing wrong.

Thank you,
Roger
______________________________
Roger "Teresk" Brown
Stratics Central Content Director
Stratics Forums Programmer
Guild Forums Administrator
teresk@stratics.com
Subject Author Views Date
Thread I Need Parents Teresk 2012 Jul 5, 2006, 12:51 PM
Thread Re: [Teresk] I Need Parents
brewt 1951 Jul 5, 2006, 4:09 PM
Post Re: [brewt] I Need Parents
Teresk 1941 Jul 5, 2006, 4:37 PM