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.

Display the values from a custom field on a rendered page in a drop down

October 27, 2011 11:47am

Subscribe [3]
  • #1 / Oct 27, 2011 11:47am

    artlab

    37 posts

    I have a custom field type with three possible options: yes, no, maybe

    I want to display these three options on a rendered template page as a drop down.
    Of course I could create a select menu and manually type in the options, but if I change the option names in the custom field, then I have to remember to also change the name in the template.  For a large list of items this because even more difficult.

    the categories tag lets me display the items in a category on a rendered template page

    <select name="catselect">
    {exp:channel:categories channel="yourchannel" style="linear"}
        <option value="{path='channel'}">{category_name}</option>
    {/exp:channel:categories}
      </select>

    I want to see if there is some comparable way to display a custom drop down field type on a rendered template page

    Thanks

  • #2 / Oct 27, 2011 12:02pm

    Noah Kuhn

    60 posts

    So you want to display a dropdown with the selected value selected on the front end?

    So if maybe is selected on the backend, you want to show a dropdown with maybe selected on the front end, but also showing the other options?

    I can’t think of any way do this out of the box. One option would be to create a channel that will serve as the options, and then set up your select drop down to be populated by that channel in the settings. Then you could print out that channel as a select dropdown and highlight the selected value based on what option has been selected in the menu. This would likely need to be an embed that you pass the value into from the main channel entries loop.

  • #3 / Oct 28, 2011 12:50am

    John Henry Donovan

    12339 posts

    Hi artlab,

    How about using a global variable for your dropdown code?

    From what you are saying do you mean that you may have different options for each entry. A dropdown menu for each entry?

  • #4 / Jan 10, 2012 12:15pm

    kaizendc

    16 posts

    Good Day,

    I think I have the same issue as this.

    I’ve create a custom Field Type (Select Dropdown) in EE Channel Fields and manually populate the content (Attachment: Form-EE.jpg) and I want to display the same content I use in (Attachment: Form-EE.jpg) to display in my search function (Attachment: Display.jpg) “Type” dropdown.

    I’ve tried to use the short name which is {vehicle_type} but instead of displaying the same content as the (Attachment: Form-EE.jpg) it display the value of each vehicle on the database (Attachment: WrongDisplay.jpg).

    Thanks

  • #5 / Jan 13, 2012 1:53am

    John Henry Donovan

    12339 posts

    hi kaizendc,

    What is your search function comprised of?
    Is it the advanced search form or a third party add-on like Solspace’s Super Search?

    What version and build of EE are you using?

    Can you share some of your relevant template code please?

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

ExpressionEngine News!

#eecms, #events, #releases