Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
replicants
vinylrecord
i have dcr which uses replicants to accept linkname, linkedpage n group to which this link belong. now in my tpl file i want to group these links based on their group. for that i need to assign the content of rep.GROUP to a variable n write a perl code in my tpl file.
i have 2 problems:
1. how to assign the content of rep.GROUP to a perl variable in my tpl file.
2. how to embed the perl code inside HTML tags in order to group links.
output should be like this
group1
link3
link2
group2
link1
link4....... n so on
Find more posts tagged with
Comments
Adam Stoller
If I understand what you're trying to do - I think you want to create a Perl hash of the values and then output from the hash. Something like (pseudo code):
my %hash;
... iterate ...
push (@{$hash{$group}}, "$linkname:$linkedpage");
... end iterate ...
foreach my $hkey (sort(keys(%hash))){
my $aref = $hash{$hkey};
iwpt_output("$hkey<br>");
foreach (
@$aref){
my($ln, $lp) = split(/:/, $_);
iwpt_output(qq(<a href="$lp">$ln</a><br>\n);
}
...
--fish
(Interwoven Senior Technical Consultant)
Adam Stoller
Since you included the code in your other thread (PLEASE - don't make multiple threads for the same topic - especially in the same forum) - I've tested my response and provide it here. I believe it does what you wanted.
--fish
(Interwoven Senior Technical Consultant)