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.

Help Using Search Parameter

June 04, 2012 4:56pm

Subscribe [3]
  • #1 / Jun 04, 2012 4:56pm

    DigitalScientist

    18 posts

    Greetings!

    Just quickly for reference: I am a designer and even though I have been using EE for years, my brain still works like a designer and sometimes it is difficult for me to visualize the reason why certain things are not working, could someone help me please?

    I am attempting to use the Search Parameter in order to limit entries printed on the page. I would like to use the exact match option.

    What I want to do, is limit items (agenda items) shown depending on which option is selected from a Select Dropdown list.

    The list that I have in my dropdown list (and I’ve made sure it is set to searchable) is as follows:

    Ballroom A
    Ballroom B
    Ballroom C
    etc, etc..

    I would like, for example, to only show the entries that are to be held in Ballroom A, using the Channel Entries Tag as follows:

    {exp:channel:entries channel="agenda_items" category="17|18|19|20" orderby="{entry_date}" sort="asc" show_future_entries="yes" search:meeting_room="=Ballroom A"}
         <div class="agendaItemContainer" id="agendaItem{count}">
          <div class="agendaItemTime" id="agendaItem{count}Time">{agenda_start_time} - {agenda_end_time}</div>
          <div class="agendaItemDescription" id="agendaItem{count}Description">{agenda_title}</div>
          <div class="agendaItemLocation" id="agendaItem{count}Location">{agenda_location}</div>
         </div>
    {/exp:channel:entries}

    What I want, is to only show the entries that have that specific option (Ballroom A) chosen on the drop down.

    I would use categories for this, but we’re already using categories for another function.

    Is there another technique I could use to limit entries by drop down or multi select, or can someone see why this isn’t working?

    Thank you for your help in advance! 😊

  • #2 / Jun 04, 2012 6:13pm

    Manoj Thomas

    185 posts

    Hey Jessica, can you post the dropdown list code you’re using?

  • #3 / Jun 05, 2012 8:07am

    DigitalScientist

    18 posts

    Hi Manoj,

    It’s a Channel Field. A Select Dropdown, Channel Field that is in the publish form.

  • #4 / Jun 05, 2012 9:03am

    DigitalScientist

    18 posts

    This is the section in the user guide I am referencing and trying to get to work:

    http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#search-field-name

  • #5 / Jun 05, 2012 1:24pm

    Dan Decker

    7338 posts

    Hi Jessica,

    I think if you adjust the search type, you might have some success. Try this:

    search:meeting_room="Ballroom&&A"

    I think the space in the “exact matching” method was the issue. Using the “contains matching” method should let us step around that.

    Let me know!

    Cheers,

  • #6 / Jun 05, 2012 1:46pm

    DigitalScientist

    18 posts

    Hi Dan!

    I tried this and it’s still not working. When I type it that way, I am not getting any entries at all.

    The biggest reason that I was using “exact match” is because the list of locations for agenda items will probably end up looking more like this:

    Ballrooms A, B, and C
    Ballroom A
    Ballroom B
    Ballrooms B and C
    Ballroom C

    So, I’m not sure “contains matching” will do I need.

    Thanks for your help, maybe there is another way to achieve this?

  • #7 / Jun 05, 2012 1:58pm

    DigitalScientist

    18 posts

    I’m thinking about your suggestion, Dan, and I really feel like it should work!

    Here is the code that I tried:

    {exp:channel:entries channel="agenda_items" category="17|18|19|20" orderby="{entry_date}" sort="asc" show_future_entries="yes" search:meeting_room="Ballroom&&A"}
         <div class="agendaItemContainer" id="agendaItem{count}">
              <div class="agendaItemTime" id="agendaItem{count}Time">{agenda_start_time} - {agenda_end_time}</div>
              <div class="agendaItemDescription" id="agendaItem{count}Description">{agenda_title}</div>
              <div class="agendaItemLocation" id="agendaItem{count}Location">{agenda_location}</div>
         </div>
    {/exp:channel:entries}

    I made sure there is an entry with the “Ballroom A” option chosen.

    Not sure why it’s not working..

  • #8 / Jun 05, 2012 2:44pm

    DigitalScientist

    18 posts

    Ok, I think I figured it out., something in the displaying of the entries is preventing anything below 5 entries to show 0 entries.

    Dan, I think your code fix, fixed everything, I just couldn’t see it until I tested different entry limits.

    Thanks everyone!

  • #9 / Jun 08, 2012 5:53pm

    Shane Eckert

    7174 posts

    Hey DigitalScientist,

    Glad to hear it!

    If you need anything else, please just let us know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases