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.

Using multiple search:custom_field parameters (OR, not AND)

August 18, 2011 12:41pm

Subscribe [2]
  • #1 / Aug 18, 2011 12:41pm

    SiteGoals

    15 posts

    I have a channel with a custom field for city. Then in the template there is a list of cities, with all the entries filtered appropriately using search:custom_field=“city” on multiple weblog:entries tags.

    Now however, I have added a secondary, optional custom field for a second city. Ideally, I would like to get entries that have either of the custom fields set to a single city. Although the search parameter can be added multiple times, it filters the entries by

    search:custom_field="city" AND search:custom_field2="city"

    instead of

    search:custom_field="city" OR search:custom_field2="city"

    How else can I accomplish this?

  • #2 / Aug 18, 2011 1:37pm

    SiteGoals

    15 posts

    Well I answered my own question. The client already had Matrix installed, which will be a much better system for this. You can search all rows of a Matrix field using the search parameter.

  • #3 / Aug 18, 2011 11:14pm

    Dan Decker

    7338 posts

    SiteGoals,

    I’m glad to see you found a workable solution.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases