SFGolfer,
What are your trying to filter here? Two fields? If so, you need two statements such as filter=”first_name=john&last_name=doe”
Otherwise, you’re searching for an entry in the emp_name list that is literally “doe, john”
This is one way putting the whole name into a single field can limit your options, and as it now stands, the filtering can’t search for anything with a space in it.
Yes, it is one field with “doe, john” as its value.
I did find a workaround. Simply do two filters, one for the last name and one for the first name.
[pdb_list fields="emp_name" filter="emp_name~doe&emp_name~john"]
Hey– good one. Never thought of that!
and as it now stands, the filtering can't search for anything with a space in it.
🙁
I was trying to implement this. I was trying a filter state=New York
This works in search but not in filters
Also is there a way to dynamically pass the filter values between pages or posts?
siteurl,
Yes filtering doesn’t work with spaces. You can try using the filter without the space at all: [pdb_list filter=”state=NewYork”]
For your second question, you’ll need to do some coding with your templates to accomplish this. You can call the shortcode with a do_shortcode() function in your template which allows you to use dynamic values in the shortcode.
Hi, I have a dropdown field wich name is “category”. It have several values: “Elite (from 12 to 20 years)”, “Promotional (from 21 to 30 years)”, etc.
I’m trying to use filter:
[pdb_list fields=”last_name, first_name, category, confirme, photo” orderby=”category” order=”asc” filter=”category=Elite (from 12 to 20 years)”]
But it doesn’t work. What is the problem?
Thank you
elmaluf,
Yeah, those parentheses are probably not going to work. Have you tried doing a partial match? filter~Elite
Hi Roland
I also have a problem using the filter option. When using this code
[pdb_list fields=”first_name, last_name, entreprise, city” orderby=”city” filter=”site=Oui/Ja”]
I get the message that no records have been found. I tried to change the ‘site’ field (radio) by not using the ‘/’ but it does not work to.
Thanks for any hint.
Regards,
Juergen
Ok, I found a workaround by replacing ‘~’ with ‘=’ but this might result in false results when using longer or more complex strings.
jue_mue,
Search terms with a slash or space will not work, so you will need to find a way around that.
That is what I thought… spaces neither. But with ‘~’ it’s fine for the moment…
Thanks for this brilliant plugin,
J.