Gossamer Forum
Home : Products : Links 2.0 : Customization :

Country/State/City

Quote Reply
Country/State/City
The catagories for my Links go:

Country/State/City

Country - Top Category
State - Sub-Category
City - Sub-Sub-Category

I would like to know how I can get my <%City%>, <%State%>, <%Country%> information that I display on my Detailed pages without having to ask the user 3 additional redundent questions, since it is the category they pick.


Thank you all very much for your help!

Will
Quote Reply
Re: [WTrippe] Country/State/City In reply to
Just create the Country, State, and City tags on the fly with a little Perl magic called split when you make the details pages... In site_html_detailed in site_html_templates.pl, add:
Code:
my $temp = $rec{Category};
$temp =~ s/_/ /;
($rec{Country}, $rec{State}, $rec{City}) = split /\//, $temp;
after:
Code:
my %rec = @_;

--Philip
Links 2.0 moderator
Quote Reply
Re: [ThatPerson1024] Country/State/City In reply to
Wonderful! Works perfect! I am learning so much in this forum! Thank you very very much!

Will
Quote Reply
Re: [ThatPerson1024] Country/State/City In reply to
You can chop the first two lines to one line....

$temp = $rec{Category} =~ s/_/ /g;

You also need a g;

Last edited by:

PaulW: Dec 13, 2001, 1:55 PM
Quote Reply
Re: [PaulW] Country/State/City In reply to
um... yeah.


--Philip
Links 2.0 moderator

Last edited by:

ThatPerson1024: Dec 13, 2001, 2:54 PM