Heya all,
My links are listed in categories like this: /Region/Country/State/
I use the global below to split up the category and return either the region, the country or the state for each link. The actual values are not saved in the links table, they're just derived from the category. The example global below returns the country:
my $tags = shift;
my $link_id = $tags->{ID};
my $link_db = $DB->table ('Links');
my ($cat_id, $cat_name) = each %{$link_db->get_categories ($link_id)};
my ($region, $country, $state) = split /\//, $cat_name;
my $output = qq~
$country
~;
return $output;
}
In my templates I'd like to do an "IF" statement to the following effect:
<%if country eg 'United States'%>Do something<%endif%>
This obviously doesn't work as "country" is not a field. Any suggestion how I can get this done?
Safe swoops
Sangiro
My links are listed in categories like this: /Region/Country/State/
I use the global below to split up the category and return either the region, the country or the state for each link. The actual values are not saved in the links table, they're just derived from the category. The example global below returns the country:
Quote:
sub { my $tags = shift;
my $link_id = $tags->{ID};
my $link_db = $DB->table ('Links');
my ($cat_id, $cat_name) = each %{$link_db->get_categories ($link_id)};
my ($region, $country, $state) = split /\//, $cat_name;
my $output = qq~
$country
~;
return $output;
}
In my templates I'd like to do an "IF" statement to the following effect:
<%if country eg 'United States'%>Do something<%endif%>
This obviously doesn't work as "country" is not a field. Any suggestion how I can get this done?
Safe swoops
Sangiro