Home › Toolset Professional Support › [Resolved] How create a view that shows items with certain content in Repeatable Field Grp?
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 10 replies, has 2 voices.
Last updated by Minesh 8 months, 2 weeks ago.
Assisted by: Minesh.
I got stuck with building the views for a website of a distributed event at hidden link
We have users who can create Locations (custom post types) and sign up to participate in a certain edition of our event, e.g. for 2024.
For this "ECD Participation" I have created a repeatable field group in Location post type, that includes the respective year as well as other fields related to the event at the location in that particular year.
Now I want to create a view (list and map) that shows all Locations that have an "ECD Participation" entry with the year ("ecd edition") 2024. But somehow it seems I don't manage to get this as a filter? How do I do this?
(btw I am more familiar with the legacy Views rather than with the block editor mode)
Here is the example from last year, the first edition: hidden link where the participation information was defined as fields directly in the Location post type, which was easy to filter but is of course not the right solution on the long run…
Hello. Thank you for contacting the Toolset support.
If you only want to attach the year as "ECD Participation" why you are using repeating field group? In that case what if you try to use taxonomy and setup term as 2024 - does that makes sence?
Thank you for your reply.
I am sorry that it seems you misinterpreted my screenshot crop. As I wrote in my text, "I have created a repeatable field group in Location post type, that includes the respective year *as well as other fields related to the event at the location in that particular year.* " hence there is much more information included in this group, that is only applicable to the respective year.
Taxonomy is hence not the solution here.
When you add repeating field group to post type it will be managed as one-to-many post type relationship internally.
You can still use classic views if you prefer while using blocks as well. Here is the doc that shows information about how you can enable the classic views while using blocks:
- https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/
Do you want frontend custom search filter to filter the repeating field group items or you want to filter just based on current year and compare the value of current year 2024 against the field "ecd edition"?
If you can share problem URL and tell me what fields you want to display on what page/post and share admin access details once I will review your setup I will be able to guide you in the right direction.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.
I see with your draft page there is a block "map-3" is added - is it required? Why its added there , can I remove it?
Do you want to display map with map block and classic view you shared?
yes you can remove the map-3
exactly, I feel more comfortable with the classic view 😉
If you are comfortable with classic view only.
Please check your view:
- hidden link
I've added the map shortcode outside the view's loop and marker shortcode inside the view's loop.
I can see it does display all markers on the draft page you shared:
- hidden link
thank you, yes the map is now being displayed with the unfiltered pins.
Now I'm curious how the filtering of "ECD Participations with year = 2024" is achieved
To filter the view with the field belong to repeating field group.
As you can see with your view - I've added the following filter to Query Filter section:
- hidden link
Select items with field:
Coworking Day Edition is a number equal to VIEW_PARAM(year)
And this is how I've added the map marker so that it should display the parent location "Geoaddress" field inside the view loop:
[wpv-map-marker map_id='map-7' marker_id='marker-[wpv-post-id]' marker_field='wpcf-geoaddress' item='@ecd-participation.parent'][/wpv-map-marker]
With the page where you added the view - I've added the "Fields and Text" block and added the view as given under where we can pass the year as view's shortcode attribute with the desired value, in this case its 2024 :
- hidden link
[wpv-view name="map-view-of-locations-24" year="2024" cached="off"]
Can you please confirm it works as expected now.
Thank you, yes the map is displaying the participating locations in 2024 now.
I have added some parameters to the map and pin and now try to adopt the content template for the popup content. I have created a copy of the "map-pin" content template as "map-pin-24" hidden link where I now need to adopt the parameter references (from "this location" to "the location parent to this ecd-participation" etc.). How is this reference inserted for conditionals, e.g. [wpv-conditional if="( $(wpcf-tagline) ne '' )"] if it referes to the tagline of the item="@ecd-participation.parent"? The visual shortcode dialogue lets me only add "of the current post" not refer to the owning/parent location…
Same question for the [wpv-view name="ecd-events-at-location-pin"] which is a view of the owning/parent Location, not of the "ECD participation"?
Thank you!
As per our support policy - We entertain only one question per ticket. This will help other users searching o the forum as well as help us to write correct problem resolution summery.
May I kindly ask you to open a new ticket with every new question you may have with all required details and kindly mark resolve this ticket as original question reported with this ticket is already addressed.
ok thanks