ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Generating Dynamic Dropdowns

May 09, 2011 4:47pm

Subscribe [4]
  • #1 / May 09, 2011 4:47pm

    iPixel

    64 posts

    Using : EE 1.x

    Hello,

    I have a custom field named “locations” which field type is set to
    dropdown and it contains some data such as NY,CA,VA,etc…

    Is there a way to view that data with ee and display it as a dropdown
    sort of like
    <select name=“somename”>
    {exp:field_group:fields field_name="locations"}
    <option>{location}</option>
    {/exp:field_group:fields}
    </select>

    I realize my syntax above is probably way off, but it’s really the only way
    i can explain what I’m trying to achieve.

    Thanks!

  • #2 / May 09, 2011 5:16pm

    Mark Bowen

    12637 posts

    Hiya,

    I do have an add-on that I wrote a while back which does this - Custom Drop Down Creator.

    If you don’t want to use that then you would need to use a SQL query to get what you need.

    Hope that helps a bit.

    Best wishes,

    Mark

    P.S. As a note this post is in the wrong section if you are using 1.x as these are the 2.x tech support forums

  • #3 / May 09, 2011 5:32pm

    iPixel

    64 posts

    Ok, how would i use SQL to do this? I have no idea what table to look at. Where can i find this out?.

    PS: Yea Support Center pointed me to this section, i didnt realise it was ee2 till after i posted.

  • #4 / May 09, 2011 6:05pm

    Mark Bowen

    12637 posts

    You would want to start looking at the exp_channel_data table to be able to do this.

    Best wishes,

    Mark

  • #5 / May 10, 2011 4:16am

    John Henry Donovan

    12339 posts

    Moving to Community Help as more appropriate there

  • #6 / May 10, 2011 5:34am

    Bjørn Børresen

    629 posts

    I think maybe I’d just create a category group called “Locations”, populate it with categories (NYC, CA, etc.) and then use the categories module to output the dropdown:

    http://www.addonbakery.com/docs/expressionengine/categories.html

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases