Dropdown menu list

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Dropdown menu list

Postby Spalace » Wed Apr 25, 2007 12:23 pm

I run a fan site for a football (uk) team and on the site I've got profiles on all the members of the squad and what I'd like to be able to do within each profile is have a dropdown menu that links to the other members in the squad.

I've tried using this code below but it's only pulling out one of the records.

Code: Select all
<select name="selectName" size="2" multiple><option value="<MaginotURL: maginot_squad>"><Field: Subject></option></select>


the page can be seen here:

http://www.superpalace.co.uk/coranto/squad/MattLawrence.asp

Is it possible so that it includes all the players from the maginot_squad profile?
Spalace
 
Posts: 36
Joined: Tue Feb 20, 2007 8:52 am
Location: London

Postby SrNupsen » Wed Apr 25, 2007 12:48 pm

You should check out the CustomFields addon by Parahead, available from his site here.

It lets you create a new type of field called "drop-down box from file", which should do exactly what you want. You'll possibly want to create a separate profile just to create the text file that this fields fetches its values from.
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Spalace » Wed Apr 25, 2007 1:48 pm

Thanks I'll take a look at it and report any issues
Spalace
 
Posts: 36
Joined: Tue Feb 20, 2007 8:52 am
Location: London

Postby SrNupsen » Wed Apr 25, 2007 2:26 pm

Another option that doesn't involve any addons:

* Create a new profile named, say, "squad_list" or similar, which will create a text file called, say, squad_list.txt

* Use this style for it:

Code: Select all
<option value="<MaginotURL: maginot_squad>"><Field: Subject></option>


Now, in your text file, you'll have a lot of these:

Code: Select all
<option value="http://www.yoursite.com/url/to/joe">Joe Johnson</option>
<option value="http://www.yoursite.com/url/to/bob">Bob Banana</option>
<option value="http://www.yoursite.com/url/to/jim">Jim Jensen</option>
<option value="http://www.yoursite.com/url/to/john">John Joe</option>


* Final: On the page where you want the drop-down box appear (using pseudo-code here because I don't know ASP)

Code: Select all
<select name="selectName" size="2" multiple>
<--#include the text file -->
</select>


In addition, if you want players to appear alplhabetically in the drop-down list, you just select "Alphabetically (by Subject)" in the "Sort order" option field on the profile's settings page.
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Spalace » Thu Apr 26, 2007 10:32 am

I was having a look at the CustomFields addon but I couldn't get it to work so I had a look at the other option you suggested and it worked a treat.

As you said, I created a new profile with the style:
Code: Select all
<option value="<MaginotURL: maginot_squad>"><Field: Subject></option>


Then in the style I use to show the squad profile I included this code in the style:

Code: Select all
<form name="jump"><select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">
<option value="Select a player">Select a Player...</option>      
<!--#include virtual="/coranto/squad_drop.txt"-->
</select>
</form>


So when a user selects a player from the dropdown it get directed straight to the players profile.

You can see it working here: http://www.superpalace.co.uk/coranto/squad/MattLawrence.asp

Only a few records in there presently as I need to upgrade the old profiles

Thanks for your help SrNupsen :D
Spalace
 
Posts: 36
Joined: Tue Feb 20, 2007 8:52 am
Location: London

Postby SrNupsen » Thu Apr 26, 2007 12:38 pm

My pleasure, glad it worked. Thanks for the writeup - very useful for others in the same situation surfing by this thread later!
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway


Return to Customization

Who is online

Users browsing this forum: No registered users and 2 guests

cron