How do i dynamically populate a drop down menu from one of my fields

19 posts by 4 authors in: Forums > CMS Builder
Last Post: July 16, 2009   (RSS)

By blillie - July 10, 2009

Okay, i think we're getting there now. If you go to:

www.fanmarketplace.com/finddeals2.php

you'll see that it isn't just putting the categories in there now, it's putting them in for each time they're used. Also, if i select one it just pulls up everything on the listings page and doesn't seem to actually work.

Can you see what I'm talking about?

thx

Brian

Re: [blillie] How do i dynamically populate a drop down menu from one of my fields

By Dave - July 12, 2009

Hi Brian,

The reason everything is coming up is because you need to give the category search pulldown a name. Right now it is:
<select>

Try changing it to:
<select name="category_match">

For more details on advanced search options see this page in the docs:
http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html

As for the repeating, do you have a separate section for just category names or do you have them just entered as text options in the field editor? (Put another way, when you edit the "category" field in the field editor, what is "List Options" set to?)
Dave Edis - Senior Developer
interactivetools.com

By blillie - July 14, 2009

I've attached a screenshot for you to review and hopefully answer your question... i did what you said but they are still repeating.
Attachments:

screen-shot.jpg 131K

Re: [blillie] How do i dynamically populate a drop down menu from one of my fields

By ross - July 14, 2009

Hi billie

Could you post an up to date copy of finddeals2.php for us? Just attach it as a file instead of pasting the code into a post (this makes it much easier to read).

I know you are very close on this one so it's probably just one more adjustment.

Post that template though and we'll go from there. Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] How do i dynamically populate a drop down menu from one of my fields

By blillie - July 15, 2009

Here is the file.

thx

Brian
Attachments:

finddeals2_001.php 12K

Re: [Damon] How do i dynamically populate a drop down menu from one of my fields

By blillie - July 15, 2009

That worked great!!! Thx

One more quick question that hopefully is an easy fix... if you look at the sidebar navigation it lists the categories as links... can you help me with some code to have that automatically populate instead of me having to manually put them in....

I've attached the file that holds the code for that area of the website.

thx

Brian
Attachments:

categorynav.php 5K

Re: [blillie] How do i dynamically populate a drop down menu from one of my fields

By ross - July 16, 2009

Hi Brian

Glad that worked :).

To get it going with links, you basically use the same code. You can just take out the <select> and </select> tags then change the <option> into an <href>

Give it a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] How do i dynamically populate a drop down menu from one of my fields

By blillie - July 16, 2009

Worked like a charm!

thx