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.

Filtering a rolling list of enteries based on choice from dropdown

April 14, 2011 1:50pm

Subscribe [5]
  • #1 / Apr 14, 2011 1:50pm

    welshartnow

    81 posts

    When loaded my events page presents a rolling list of events, there are many events and so I have included pagination.  These events take place in different cities and city is one of the fields that I have defined within my event channel.  At the top of my template I have included a dropdown of cities. The idea being that the viewer can restrict the list of enteries by selecting a particular city.  My question is how do I filter the view to the city choice of the user?

  • #2 / Apr 15, 2011 5:59am

    John Henry Donovan

    12339 posts

    welshartnow,

    Dynamic Parameters would be perfect here

    If you need further help with it let us know

  • #3 / Apr 15, 2011 6:03am

    welshartnow

    81 posts

    Thanks John will check out and try

  • #4 / Apr 15, 2011 9:55am

    welshartnow

    81 posts

    Having tried this it certaily seems to be the direction I want to go.  The problem I have is that the list of enteries is goverened by defined parameters such as sort.  I need to limit the view according to a field value called place which is a field I have defined within event.  I have tried the code below but without luck

    <form method="post" action="{path='event/events'}">
    <select name="place">
    <option value="x">Sort By:</option>
    <option value="a">a</option>
    <option value="b">b</option>
    <option value="c">c</option>
    </select>
    <input type="submit" value="Go!" />
    </form>
    
    {exp:channel:entries channel="events" dynamic_parameters="place"}
    {title}<br>
    {/exp:channel:entries}
  • #5 / Apr 15, 2011 10:59am

    John Henry Donovan

    12339 posts

    welshartnow,

    Try this for a dynamic field

    {exp:channel:entries channel="events" dynamic_parameters="search:place"}
  • #6 / Apr 15, 2011 4:34pm

    welshartnow

    81 posts

    Hi John,
    great this worked for me

    <body>
    <form method="post" action="{path='view/view'}">
    
    <select name="search:venueplace">
    <option value="">Sort By:</option>
    <option value="a">a</option>
    <option value="b">b</option>
    <option value="c">c</option>
    </select>
    
    
    
    <input type="submit" value="Go!" />
    </form>
    {exp:channel:entries  channel="venues" dynamic_parameters="search:venueplace"  }
    {venueplace}
    {/exp:channel:entries}
    </body>
  • #7 / Apr 17, 2011 11:24am

    Sue Crocker

    26054 posts

    Glad John was able to help. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases