Webmastersite.net
Register Log In

Custom link field
Drop down selector from custom field

Comments on Custom link field

xtree


Usergroup: Customer
Joined: Aug 02, 2005
Location: Romania

Total Topics: 19
Total Comments: 50
xtree
Posted Sep 29, 2005 - 6:22 PM:

I have created a custom link field named 'country' to serve for selecting the country/region for each website. I made it user-submittable, also I figured out how to display it with the links (added its variable to the template).

My goal is to be able to use this as a link filter through a dropdown box that should restrict links being desplayed to a particular country. Ive read some posts but couldnt make it work.
I understand that I do need to add html code for dropdown boxes but other than the selector name (country) I do not know what options/values to use (as I'm not very familiar with html forms)and generally how to integrate this with the values/options I've added in the custom link field.

A small practical example here would be priceless.

Thank you.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 01, 2005 - 3:33 PM:

What's wrong with the example in the manual? You'll have to explain. scripts.webmastersite.net/w...nks/wsnmanual/articles/201
xtree


Usergroup: Customer
Joined: Aug 02, 2005
Location: Romania

Total Topics: 19
Total Comments: 50
xtree
Posted Oct 01, 2005 - 7:26 PM:

I guess its my mistake...I thought I read all articles in the manual related to fields; I missed that one.

That example seems to be exactly what I asked for.

Thanks once again..sorry for the trouble.
xtree


Usergroup: Customer
Joined: Aug 02, 2005
Location: Romania

Total Topics: 19
Total Comments: 50
xtree
Posted Oct 04, 2005 - 10:26 AM:

I have created a custom link field (just for testing) named "coloristic" with the options: black,white,yellow,blue.

The field displays in the suggest link page and I've added a few links with different values (black, white,yellow)

I want to create a select box for the visitors to sort links by color. Following the example in the manual (Filters article) I added the code below to the displaylinks.tpl template. It displays correctly but doesnt do anything (well, nothing good). Can you please help me troubleshoot it. The URL being displayed when I use the filter is localhost/wsnlinks/index.ph...id=2&filter=coloristic (I've set it up to run locally for testing).

<form action="index.php?action=displaycat&catid={CATID}&filter=coloristic" method="post">
Show
<select name="filtervalue">
<option value="black">black</option>
<option value="white">white</option>
<option value="yellow">yellow</option>
<option value="blue">blue</option>
</select>color links <input type="submit">
</form>


I think the manual article here is less self explanatory than for other articles so its not clear what goes where. For example is says: "To remove a filter you can use filtervalue=removefilter, and to remove all filters at once you can use filtervalue=removefilters." Where do these go?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 05, 2005 - 2:13 PM:

Manual is missing the necessary &linkfilteraction=add (corrected now). Use
<form action="index.php?action=displaycat&catid={CATID}&filter=coloristic&linkfilteraction=add" method="post"> 
Show
<select name="filtervalue">
<option value="black">black</option>
<option value="white">white</option>
<option value="yellow">yellow</option>
<option value="blue">blue</option>
</select>color links <input type="submit">
</form>
xtree


Usergroup: Customer
Joined: Aug 02, 2005
Location: Romania

Total Topics: 19
Total Comments: 50
xtree
Posted Oct 05, 2005 - 5:02 PM:

Works just fine now...thanks for troubleshooting it.


xtree


Usergroup: Customer
Joined: Aug 02, 2005
Location: Romania

Total Topics: 19
Total Comments: 50
xtree
Posted Oct 11, 2005 - 5:25 PM:

This might sound dumb but can I have a multi select combo box as a field and use a simple dropdown box selector at the front end? I want to be able to select multiple option when I edit/add a new listing but to allow the users only one option.

If so what do I need to change within the code. I've tried it with the current code but it doesnt do anything.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 11, 2005 - 9:49 PM:

You can't set multiple filters at once.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.