Skip Navigation

[Resolved] Displaying Repeatable Group

This support ticket is created 4 years, 10 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 27 replies, has 3 voices.

Last updated by ceciliaW9184 4 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1571195
Elementor Multi Site.png

Tell us what you are trying to do?
I have a created several search views that uses the "clinical-site-address" field to sort by location. My client now wants multiple site options. So I created a repeatable group for multiple locations.

Here is a test Trial that I created with multiple locations:
hidden link
This trial has locations in Cleveland - OH, Sarasota - FL, Oklahoma City - OK, and New York - NY

ISSUE #1:
I do not know how I can get my "Search by Location" views to pick up the multiple locations. eg. When i search New York, NY this test trial does not come up.

Here are the views i'm referring to:
hidden link
hidden link
hidden link

ISSUE #2:
Each trial is show on it's own page. How can I get the list of sites (City and State) to show up in the Multisite locations section. Here is the link to the Elementor Template. See Screenshot.
hidden link

ISSUE #3:
Also This trial is not is not showing up in the results of these 2 views (Is it because of the repeatable group?):
hidden link
hidden link

Is there any documentation that you are following?
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/
I've also watch several of the Youtube videos from Toolset (Dario).

Thank you very much for your help!

#1571595

Hello,

I have edited your post to remove the credentials, it is not safe to share them publicly.

ISSUE #1:
The Toolset repeatable group is based on one-to-many relationship, so each item of repeatable group is also a single post, in your case, each item of repeatable group is a single post of post type "list-locations".

And Views is using WordPress Class WP_Query to query posts, so if you are querying "Trial" posts, you can not filter/order the result by fields another post type, this is a limitation of WordPress Class WP_Query .

So you will need to setup a post view:
- Query "list-locations" posts
- Filter by fields of "list-locations" repeatable group: city-state, address ...
- In view's loop, display it's parent "Trial" post information:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-one-related-item-parent

But you will not be able to filter/order the result by "Trial" post's custom fields.

ISSUE #2:
You can create a post view:
- Query "list-locations" posts
- Filter by:
Repeatable field groups filter, see our document:
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups
section "Displaying Repeatable Field Groups", screenshot:
https://toolset.com/wp-content/uploads/2019/11/repeatable-field-group-view-creation-wizard.png
- And follow our document to display views results as Google maps:
https://toolset.com/documentation/getting-started-with-toolset/display-posts-on-maps/

Then display above post view into single "Trial" content.

ISSUE #3:
Please elaborate the questions with more details:
Also This trial is not is not showing up in the results of these 2 views
Which "trial" post do you want to show up? Where do you want it to show up?

#1574097
Search.png
Location Search.png

Thank you. I was able to get the list of my locations to show up in the Single Trial posts.

I want to confirm one thing. You are saying it is NOT possible for me to do a Location search with an Address field in the Trial custom post type and an Address field the List of Locations post type.

eg.
Entering Austin in this search box (See Screenshot):
hidden link

Will not find this Trial where Austin, TX is an address in the List of Locations.
hidden link

I tried to change the "Compare_Field" in the Search and Pagination Section of the View (See Screenshot). This did not work.

If this is the case, is there ANY way around this? I really need to be able to search all locations?

#1575105

You can search all locations, see my answer above:
https://toolset.com/forums/topic/displaying-repeatable-group/#post-1571595


ISSUE #1:
you will need to setup a post view:
- Query "list-locations" posts
- Filter by fields of "list-locations" repeatable group: city-state, address ...
- In view's loop, display it's parent "Trial" post information:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-one-related-item-parent

And follow our document to setup the distance search on above post view:
https://toolset.com/documentation/user-guides/maps/display-on-google-maps/filtering-and-ordering-map-markers-by-distance/

#1578823
Views.png

I have read through these links many times and I still don't understand how I can loop this new List of Locations into my original list of Location of trials.

Here is a video of the 2 views I created:
hidden link

I created a Query List of Locations. You can see it here.
hidden link

Views:
#1) Search List of Locations - this is the query the my list of locations that is the repeatable group in the Trial Locations.

#2) Zip Code Search - the is the main list of Trial locations. This is where I want to have my repeatable groups show up in the search query.
hidden link

The documentation you provided doesn't have screenshots showing how to insert this view into the new List of Locations view. This is where I get lost.

#1579317

The screenshot you provided above:
https://toolset.com/wp-content/uploads/2020/04/1578823-Views.png
It is for Blocks editor, but your video is using classic editor, so there might be some GUI difference.

Let me elaborate the issue #1 with more details:
If you want to search the result by fields of "list-locations" items, then you can try these:
Create a new page, in this page below post view:
- Query "list-locations" posts
- Filter by fields of "list-locations": city-state, address ...
- In view's loop, display it's parent "Trial" post information
It will be able to filter/order the results by custom fields of "list-locations" items, it won't be able to filter/order the results by custom fields of "Trial" post type.

If you still need assistance for it, please provide a test site with the same problem, fill below private message box with login details, also point out the problem page URL and view URL, I can setup a demo for you. Private message box enabled.

#1580435

I have tried the credentials you provided above, it is not valid, I get this error:
Unknown username. Check again or try your email address.

Please check it, make sure it is an valid admin account, thanks

#1583567

Both credentials are not valid, I get these error messages:
Oops !
Error: The password you entered for the username Guest is incorrect. Lost your password?

Please provide a copy of your website in below private message box:
https://toolset.com/faq/provide-supporters-copy-site/

You can put the duplicator package in your own google drive disk, and share the link in below private mssage box.

I need to test it in a live website, then provide detail steps to setup the demo.

#1584785

Thanks for the details, I am downloading the files, will update here if there is anything found

#1584849
distance-filter.JPG

Please try these in yoru website:
Edit post view "Zip Code Search" ( ID:399)
- In section "Content Selection", choose only one option: "List of Locations"
- in section "Search and Pagination", edit the distance filter, option "Comparison Field - required" choose "Address", see screenshot distance-filter.JPG
- in section "Loop Editor", find and edit the content template, change it from:
[wpv-post-body view_template="loop-item-in-zip-code-search"]
To:

[wpv-post-body view_template="loop-item-in-zip-code-search" item="@list-locations.parent"] 
[wpv-map-marker map_id='map-11' marker_id='marker-[wpv-post-id]' marker_field='wpcf-address'][/wpv-map-marker]

Above first line will display the content template using parent "Trials" post information,
The second line will display the "address" field as a map marker.

Then test it again.

#1593189
Search Results.png

I followed your instructions and it did not work. However, i tweaked it and am very close to getting it to work.

Here is what I changed:
1) Content Selection - List of Additional Locations only
2) Query Filter - Field to compare to = Address of Additional Locations
3) Search & Pagination - compare_field = "address-additional-locations"
4) Loop Editor - [wpv-post-body view_template="loop-item-in-zip-code-with-rfg"]
5) Custom Posts - I eliminated the use of clinical-trial-site-address and am just using the RFG for all locations, whether there is 1 location of many.

You can see from the results the map shows all of the markers and they are searchable. Now i just need the search results to show up like had before (see screenshot). Right now it is showing something i don't recognize (18640, 19641, Detroit, MI). You'll see in this video.

If you can just help me get the search results working, that will be perfect!

Also, i noticed the markers are showing my current location (Toronto, Ontario, Canada). i don't have any data points in Toronto.

hidden link

#1593207

I forgot to mention that I tried both of these shortcodes in the Loop Editor:

[wpv-post-body view_template="loop-item-in-zip-code-with-rfg" item="@list-of-locations.parent"]

[wpv-post-body view_template="loop-item-in-zip-code-with-rfg"]

#1594583

Here is a link to my test site in case you wanted to see it.

hidden link

#1595469

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Luo is on vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.

I see you shared the following test site with test page:
=> hidden link

I see Luo has already helped you with the steps, can you please clarify whats working now and whats not working where exactly you need help.

Can you please send me temporary access details as well so I can dive into admin.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1595595

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

With your view:
=> hidden link

Within the Loop editor, I've changed the following line of code from:

 [wpv-post-body view_template="loop-item-in-zip-code-with-rfg" ]

To

 [wpv-post-body view_template="loop-item-in-zip-code-with-rfg" item="@additional-locations.parent"]

I can see now it displays the information. Can you please confirm it works at your end.