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.

Can't search drop-down populated by another channel field.

February 14, 2012 5:32am

Subscribe [1]
  • #1 / Feb 14, 2012 5:32am

    Jepson+Rae

    4 posts

    I’m using the following code (which works fine if I manually enter options for the drop-down menu but doesn’t if it’s populated by another channel field):

    {exp:channel:entries channel="products" limit="3" search:print="{exp:session_variables:get name="sv_print"}"}
        {title}
    
    {/exp:channel:entries}

    Anyone know of a solution to this?

    Thanks.

  • #2 / Feb 14, 2012 12:13pm

    Jepson+Rae

    4 posts

    *bump*

    Realise I initially posted this at a silly hour (in the US).

  • #3 / Feb 14, 2012 7:24pm

    Sean C. Smith

    3818 posts

    Hi jepson+Rae,

    I’m unfamiliar with the addon that you are using to populate the search parameter. Since the tag works fine when you manually enter the correct terms that would suggest that the issue is with the add-on you are using. I would recommend contacting the add-on author for support on this.

    Sean

  • #4 / Feb 15, 2012 4:10am

    Jepson+Rae

    4 posts

    I should have said - the addon isn’t an issue (all it does is store a php session variable). Even if I replace the addon bit with the name of an item that is in the list it won’t work.

    When I say manually I mean that there are two options to populate the list:

    Populate the menu manually
    Populate the menu from another channel field

    If you select populate the menu manually then you just enter items into a text field, each item on a different line, and that’s your list. Searching this works fine. It’s when I grab values from a field in another channel to fill the list with items that it won’t let me search it.

  • #5 / Feb 15, 2012 10:58am

    Jepson+Rae

    4 posts

    *bump* again!

  • #6 / Feb 16, 2012 6:36pm

    Sean C. Smith

    3818 posts

    Hi Jepson+Rae,

    I have just tested this on my sandbox install. I created a new channel and added a field called fruit and then made three entries that I put in apple, orange, strawberry. I then created a dropdown field in another channel and had it populated by the fruit entry. Made several entries - 3 for strawberry, two for orange and one for apple. I then tested the following code:

    {exp:channel:entries channel="test" limit="3" search:drop="apple"}
        {title}
    
    {/exp:channel:entries}

    This worked as expected for me. When you replace the add-on bit with the name of an item that is in the list, have you double checked that you have no typos and that there are items that will display based on the chosen term?

    Sean

  • #7 / Feb 17, 2012 6:07am

    Jepson+Rae

    4 posts

    Hi Sean,

    Got it all sorted now. I’m not sure what the issue was because I scrapped it and went back to it later to redo it. Initially I’d tried replacing the session_var plugin with the name of a print and it still didn’t work but after scrapping it and going back it did.

    Thanks for the help 😊

  • #8 / Feb 20, 2012 4:23pm

    Shane Eckert

    7174 posts

    Hello Jepson+Rae,

    I am happy to hear Sean was able to help you!

    That’s awesome.

    Have a great week.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases