Hello,
I have a state field added in links.def and when a user fills in the submission form, I collect the state abbreviation and zip code etc.,
I would like to use the state abbreviation and display the full state name in the link.html and detailed.html etc., templates.
When I use the following in each of the subroutines, I am able to accomplish what I want. However, instead of using this each time in each sub, which makes the site_html_templates.pl file too long, I only want to use it once at the bottom.
if ($rec{'State'} eq 'AZ') {
$state_name = Arizona;
}
elsif ($rec{'State'} eq 'CA') {
$state_name = California;
}
elsif ($rec{'State'} eq 'CO') {
$state_name = Colorado;
}
and then in the "sub site_html_link" and other routines, pass on the state_name as state_name => $state_name,
to be able to show the full state names in corresponding templates with the tag <%state_name%>.
Can you help me finish the sub-routine to pass the state_name properly to corresponding subs and then I can use the <%state_name%> in corresponding templates to display the full state name?
Thanks
I have a state field added in links.def and when a user fills in the submission form, I collect the state abbreviation and zip code etc.,
I would like to use the state abbreviation and display the full state name in the link.html and detailed.html etc., templates.
When I use the following in each of the subroutines, I am able to accomplish what I want. However, instead of using this each time in each sub, which makes the site_html_templates.pl file too long, I only want to use it once at the bottom.
if ($rec{'State'} eq 'AZ') {
$state_name = Arizona;
}
elsif ($rec{'State'} eq 'CA') {
$state_name = California;
}
elsif ($rec{'State'} eq 'CO') {
$state_name = Colorado;
}
and then in the "sub site_html_link" and other routines, pass on the state_name as state_name => $state_name,
to be able to show the full state names in corresponding templates with the tag <%state_name%>.
Can you help me finish the sub-routine to pass the state_name properly to corresponding subs and then I can use the <%state_name%> in corresponding templates to display the full state name?
Thanks