Skip Navigation

[Resolved] search on winefarmers isn't searching on repeatable groups (in this case wines)

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by Christian Cox 5 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1206119

I am trying to: search for the repeatable groups, in this case the wines that a winefarmers creates

Link to a page where the issue can be seen: hidden link

I expected to see: all farmers that create a specifix type of wine.

Instead, I got: the center of the world withoud any markers on it

#1206433
Screen Shot 2019-02-26 at 11.20.23 AM.png

Hi, the problem here is combined search using criteria from the parent post and the child repeatable field groups (RFGs). Your View is set up to search for text in the RFG, and also search for a custom field in the parent Wijnboeren post. This type of combined search filter isn't currently supported but we are working on some updates that will improve searching in RFGs and related posts. We hope to have those available soon but they are not quite ready yet.

For now, you can search using filters in either the parent post or in the RFG, but not in both at the same time. The best way to handle this is to move the "Land" field into the repeatable field group (RFG) and remove "Wijnboeren" from the View's content selection area. Each time you add a new Wijn RFG, you must select Land for each Wijn.

#1206963

Hi, thanks for the answer. I moved it but now I don't get it to work. Can you help me?

#1207153

I added "Nederland" in the "Land" field for each RFG (see land.png).

I removed "Wijnboeren" from the View's content selection (see content-selection.png).

I added item='@wijnen.parent' to the map marker shortcode, because the 'adres' field is on the parent post not the RFG, and I changed marker_id to be dynamic:

[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-id]' marker_icon='//winetable.koelictontwikkelt.nl/wp-content/plugins/toolset-maps/resources/images/markers/Buildings.png' marker_field='wpcf-adres' item='@wijnen.parent']

Please check now.

#1207371

Wow, the search seems to be working on the wine names 🙂

But the lay-out of the map is now messed up.
This part isn't working correct anymore. It isn't taking the name of the post title but only the name of the first wine. And the View "soorten-wijn" isn't looping the wines anymore. Do you see that as well?

<div id="post-title">De wijnen van [wpv-post-title]: <br /><hr></div>
[wpv-view name="soorten-wijn"]

#1207724
Screen Shot 2019-02-28 at 10.08.44 AM.png

Okay I can show you how to fix those problems. I updated the wpv-post-title shortcode to display the parent post title:

<div id="post-title">De wijnen van [wpv-post-title item='@wijnen.parent']: <br /><hr></div>

Please review the documentation here for more information: https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-one-related-item-parent

Then I changed the View shortcode to pass in the parent post ID as a shortcode attribute:

[wpv-view name="soorten-wijn" wpvrelatedto="[wpv-post-id item='@wijnen.parent']"]

Finally, I adjusted the Query Filter in the soorten-wijn View to respond to a shortcode attribute. See the attached screenshot here, and review the documentation here: https://toolset.com/documentation/user-guides/passing-arguments-to-views/