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.

Filter by multiple-custom fields

February 08, 2011 11:37am

Subscribe [5]
  • #1 / Feb 08, 2011 11:37am

    marcxdid

    2 posts

    Hello,

    I have been looking into creating a multiple-field filter based on custom fields from a weblog. It would work something like this

    Country: <dropdown>
    Price Range: <dropdown>
    Type: <dropdown>
    <search>

    All three are custom fields in the weblog entries. I’ve seen this can be done with Super Search extension, but is there anyway to do this with just Expression Engine?

    I’m currently using EE 1.6.7

    Thanks.

  • #2 / Feb 08, 2011 5:03pm

    Ingmar

    29245 posts

    Have you tried Dynamic Parameters together with search?

  • #3 / Feb 09, 2011 2:27pm

    ronanmcmahon

    13 posts

    Hello,

    Thank you for your quick reply. I’m using the following code which works, however is there a way for it to not show all the properties on the first page?

    <form action="{path='property/index'}" method="post">
    <select name="search:country">
    <option value="">Country</option>
    <option value="Mexico">Mexico</option>
    <option value="Costa Rica">Costa Rica</option>
    <option value="Nicaragua">Nicaragua</option>
    <option value="Belize">Belize</option>
        </select>
    <select name="search:price">
    <option value="">Price</option>
    <option value="50k-100k">50k-100k</option>
    <option value="100k and More">100k and More</option>
    </select>
    
        <select name="search:place">
            <option value="Beachfront">Beachfront</option>
            <option value="Mountain">Mountain</option>
        </select>
    <input type="submit" value="Submit">
    </form> 
    
    {exp:weblog:entries weblog="property" sort="asc" orderby="title" dynamic_parameters="search:country|search:price|search:place" search:country="" search:price="" search:place""} 
    {title}
    {price}
    {place}
    {country}
    {/exp:weblog:entries}

    edit: I’m the same user as marcxdid, just used the wrong login.

  • #4 / Feb 10, 2011 4:37am

    John Henry Donovan

    12339 posts

    ronanmcmahon,

    Add a dummy value to your search:counry should do it for you

    {exp:weblog:entries weblog="property" sort="asc" orderby="title" dynamic_parameters="search:country|search:price|search:place" search:country="dummy"}
  • #5 / Feb 24, 2011 8:14am

    webnology

    353 posts

    Hi, following this question… How can I populate the dropdown menus based on the custom field options that I added in the admin?

    All help appreciated,
    Michel

  • #6 / Feb 24, 2011 9:52am

    Mark Bowen

    12637 posts

    If the fields are drop-down fields that you created the options for them in the admin panel then you could use a plugin I wrote a while back called Custom Drop Down Creator.

    If not then you would probably need to either run weblog tags to get at the data or run a custom sql query.

    Best wishes,

    Mark

  • #7 / Feb 24, 2011 4:53pm

    Ingmar

    29245 posts

    Thanks, Mark. Does that help, Michel?

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

ExpressionEngine News!

#eecms, #events, #releases