Gossamer Forum
Home : Products : Links 2.0 : Customization :

Hop to dropdown

Quote Reply
Hop to dropdown
I made a hop to box for links categories that works and looks like the ubb hop to box. Saw a links1 version in the resource center and thought I'd make one
at the bottom of site_html_templates.pl just before the 1; ADD
Code:
#################################
sub hopto_category {
#################################
$output = qq~<script>
<!--
function taking()
{
location=
document.take.take2.options[document.take.take2.selectedIndex].value
}
//-->
</script>~;

$output .= qq(<form name="take"><b><font size="2">Hop to: </font></b><select name="take2">
<option selected value="">Select a Category</option>
<option value="">-------------------------------</option> );

CATEGORY: foreach $cat (sort keys %category) {
next CATEGORY if ($cat =~ /^\s*$/); # How'd that get in here? =)

$title = &build_unlinked_title ($cat);
@categorylist = split (/\//, $cat);

$output .= qq~<option value="$build_root_url/$cat/">$title</option>~;
}

$output .= qq~</select><input type="button" value="Go!" name="B1" onClick="taking()"></form>~;

return $output;
}
#########################################

then add hopto => &hopto_category,to the template load for the approriate page like the example below

Code:
sub site_html_home {
# --------------------------------------------------------
# This routine will build a home page. It is not meant to have any
# links on it, only subcategories.

return &load_template ('home.html', {
category => $category,
hopto => &hopto_category,
grand_total => $grand_total,
astlink => $lastlink,
%globals
});
}

then in your templete put <%hopto%> where you want the box to appear. I put it on the home.html and category.html. Hope you like it Smile

---------------------------
bartour.hypermart.net

[This message has been edited by Mutt (edited December 12, 1999).]
Subject Author Views Date
Thread Hop to dropdown Mutt 8458 Dec 12, 1999, 2:49 AM
Post Re: Hop to dropdown
Eliot 8396 Dec 12, 1999, 7:53 AM
Post Re: Hop to dropdown
herbalife 8341 Dec 12, 1999, 1:14 PM
Post Re: Hop to dropdown
Mutt 8332 Dec 12, 1999, 3:50 PM
Post Re: Hop to dropdown
herbalife 8368 Dec 12, 1999, 7:28 PM
Post Re: Hop to dropdown
herbalife 8364 Dec 13, 1999, 10:46 AM
Post Re: Hop to dropdown
Mutt 8386 Dec 13, 1999, 1:44 PM
Post Re: Hop to dropdown
herbalife 8328 Dec 13, 1999, 10:22 PM
Post Re: Hop to dropdown
herbalife 8362 Dec 13, 1999, 10:34 PM
Post Re: Hop to dropdown
Mutt 8372 Dec 14, 1999, 12:51 AM
Post Re: Hop to dropdown
herbalife 8359 Dec 14, 1999, 1:04 PM
Post Re: Hop to dropdown
thoha 8366 Apr 11, 2000, 6:49 AM
Post Re: Hop to dropdown
socrates 8366 Apr 29, 2000, 8:36 PM
Post Re: Hop to dropdown
Stealth 8403 Apr 29, 2000, 8:57 PM
Post Re: Hop to dropdown
socrates 8331 Apr 30, 2000, 10:59 AM
Post Re: Hop to dropdown
Stealth 8336 Apr 30, 2000, 11:04 AM
Post Re: Hop to dropdown
socrates 8354 Apr 30, 2000, 11:14 AM
Post Re: Hop to dropdown
Stealth 8395 Apr 30, 2000, 11:18 AM
Thread Re: Hop to dropdown
Stealth 8367 Apr 30, 2000, 5:41 PM
Thread Re: Hop to dropdown
marcoBR 8320 Jul 14, 2000, 6:26 PM
Thread Re: Hop to dropdown
socrates 8484 Jul 14, 2000, 9:17 PM
Thread Re: Hop to dropdown
marcoBR 8320 Jul 14, 2000, 11:51 PM
Thread Re: Hop to dropdown
Bobsie 8260 Jul 15, 2000, 9:47 AM
Thread Re: Hop to dropdown
marcoBR 8263 Jul 15, 2000, 10:08 PM
Thread Re: Hop to dropdown
marcoBR 8198 Aug 19, 2000, 2:04 PM
Thread Re: Hop to dropdown
marcoBR 1937 Aug 24, 2000, 9:38 AM
Thread Re: Hop to dropdown
marcoBR 1786 Nov 23, 2000, 4:54 PM
Post Re: [marcoBR] Hop to dropdown
cvance 1545 Feb 6, 2003, 10:03 PM