Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [ryel01] Getting an array of passed in values and looping

Quote Reply
Re: [ryel01] Getting an array of passed in values and looping In reply to
Hi,

They are stored in the tag, seperated by \n I believe.

Something like this should do it;

Code:
sub {
my @cut = split /\n/, $_[0]
my @tmp;
foreach (@cut) {
chomp;
my $tmp_hash;
$tmp_hash->{val} = $_;
push @tmp, $tmp_hash;
}
return { val_loop => \@tmp };
}

..then call with;

Code:
<%global_name($FieldToRunThroughIt)%>
<%if val_loop%>
<%loop val_loop%>
<%val%><br/>
<%endloop%>
<%endif%>

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Getting an array of passed in values and looping ryel01 1851 May 30, 2005, 5:22 AM
Post Re: [ryel01] Getting an array of passed in values and looping
Andy 1765 May 30, 2005, 6:01 AM