• Resolved Nifty

    (@niftythree)


    Hi Andrea,

    Hope you’re well!

    We’re trying to create a custom directory that will filter users of a specific gender who live in one of a number of selected locations. For example, we want to show all males who live in USA. Your info here has been really helpful, but we can’t work out how to filter based on the way we currently have our Location profile field formatted.

    The profile field we have for Location (field = 92) is a drop-down select box with options like:
    New York, USA
    Texas, USA
    California, USA
    Melbourne, Australia
    Sydney, Australia
    etc.

    Because of the commas in the Location field options, the filtering doesn’t work. E.g. using:
    [bps_directory field_3_="Male" field_92_one_of="New York, USA,Texas, USA,California, USA"]
    results in only one user being shown (i.e. it essentially breaks).

    We understand the filtering would work if we removed the commas and changed our Location profile field options to:
    New York USA
    Texas USA
    California USA
    Melbourne Australia
    Sydney Australia
    etc.

    but we’re sticklers for grammar and want to keep the commas there!

    Any ideas on how we can have our cake and eat it too? ??

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hi Nifty.

    A little undocumented feature will help you here. Try using:

    [bps_directory field_3="Male" field_92_one_of="New York, USA|Texas, USA|California, USA" split="|"]

    This is just an example, you can use any character to split your list.

    Thread Starter Nifty

    (@niftythree)

    Hi Andrea,

    Thanks so much; this worked perfectly! ??

    Plugin Author Andrea Tarantini

    (@dontdream)

    Great, you’re welcome!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom directory search with commas’ is closed to new replies.