1

I'm trying to render a list of entry titles into a drop menu using Stash. However, I get no results. I modeled my solution using another thread here, but no go. Any help will be appreciated.

{exp:stash:set_product_list name="product_list_name" parse_tags="yes"}
   {exp:channel:entries channel="product_profiles"}
        {stash:product_title} {title} {/stash:product_title}
        {stash:product_entry_id} {entry_id} {/stash:product_entry_id}
   {/exp:channel:entries}
{/exp:stash:set_product_list}

<!--initial display field is blank-->
     <option value="" selected></option>

<!--values show in dropdown--->
     {exp:stash:get_product_list name="product_list_name" unique="yes"}
        <option value="{product_entry_id}">{product_title}</option>
     {/exp:stash:get_product_list}

1 Answer 1

1

Your usage of the stash tags is slightly wrong. It should be {exp:stash:set_list} not {exp:stash:set_product_list}. The same applies to your usage of the {exp:stash:get_list} tag.

Updating your code to the following should work correctly:

{exp:stash:set_list name="product_list_name" parse_tags="yes"}
   {exp:channel:entries channel="product_profiles"}
      {stash:product_title} {title} {/stash:product_title}
      {stash:product_entry_id} {entry_id} {/stash:product_entry_id}
   {/exp:channel:entries}
{/exp:stash:set_list}

<select name="product_select">
    <!--initial display field is blank-->
    <option value="" selected></option>

    <!--values show in dropdown-->
    {exp:stash:get_list name="product_list_name" unique="yes"}
        <option value="{product_entry_id}">{product_title}</option>
    {/exp:stash:get_list}
</select>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.