Skip Navigation

[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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 7 months, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2690795
Bildschirmfoto 2024-04-03 um 09.55.33.png

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…

#2690851

Minesh
Supporter

Languages: English (English )

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

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?

#2690856
Bildschirmfoto 2024-04-04 um 09.01.47.png

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.

#2690907

Minesh
Supporter

Languages: English (English )

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

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.

#2691538

Minesh
Supporter

Languages: English (English )

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

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?

#2691541

yes you can remove the map-3

exactly, I feel more comfortable with the classic view 😉

#2691542

Minesh
Supporter

Languages: English (English )

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

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

#2691544

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

#2691545

Minesh
Supporter

Languages: English (English )

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

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.

#2691565

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!

#2691574

Minesh
Supporter

Languages: English (English )

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

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.

#2692563

ok thanks