Skip Navigation

[Resolved] Repeating Groups

This support ticket is created 2 years, 12 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 16 replies, has 2 voices.

Last updated by Minesh 2 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2037333

Tell us what you are trying to do?

Further to my previous ticket (https://toolset.com/forums/topic/adding-a-repeatable-group-to-post-forms/), I am trying to get my head around the repeating field groups. Perhaps if explain my specific problem you can help me with the appropriate solution.

I'm building a site for a client that is a registry of research studies so I have created a CPT called "Studies" and it has it's own custom fields called "Study Fields". Amongst these I had originally created a single line field called "Project Lead" and a repeating single line field called "Project Collaborators" (so each Study always has a lead, but can also have any number of collaborators, or none). This worked fine.

The client then asked if we could add number fields that could correlate to the lead and/or collaborators to their IDs on another registry of published academics. My initial issue is that not all the collaborators will have an ID for this other registry or else i might have just settled for a second set of repeating fields.

So, within my "Study Fields", I created a test repeating field group as per the instructions via the link below, and created a separate form for these test fields. On my content template for my "Studies" I tried to add a view that would called that study's repeating field groups but I can't find them listed in the "Study Fields" under the current study option.

I'm sure its just something I'm missing, but I'm really struggling to follow these guides and achieve any degree of success. Hopefully you can help me out.

Is there any documentation that you are following?

I've been trying to follow these:
https://toolset.com/course-lesson/front-end-forms-for-repeatable-field-groups/
https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/

Is there a similar example that we can see?

What is the link to your site?

Happy to share this privately.

#2037823

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I'm not sure where exactly you need help.

Do you need help to setup the form to add repeating field entry or you want to display the custom field belongs to repeating field within your view?

#2037883

Thanks for your reply. I believe I have set the form up correctly, so what I need, initially, is help displaying those fields on the front end (within a content template).

#2037897

Minesh
Supporter

Languages: English (English )

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

Here is the Doc where you can find step-by-step information about how you can display the repeating field group:
=> https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups

#2038033
Screenshot 2021-04-30 at 14.51.37.png
Screenshot 2021-04-30 at 14.44.02.png
Screenshot 2021-04-30 at 14.43.51.png
Screenshot 2021-04-30 at 14.42.17.png

Thanks, I've already looked at that (as per my first message). I also said:

"On my content template for my "Studies" I tried to add a view that would called that study's repeating field groups but I can't find them listed in the "Study Fields" under the current study option."

My issue is with step 4 in the guide - "Finally, add Toolset blocks to display fields coming from your repeatable field group."

I've attached images to help, hopefully. The first shows the View is set up to use my repeatable group in the content selection. The middle 2 show the available fields under that it lets me choose from with the Single Field block, of which I am expecting to see "TRG Name" and "TRG URL". The last one shows the options with the Repeating Fields block.

#2038135

Minesh
Supporter

Languages: English (English )

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

Can you please share problem URL on what content template you want to display what repeating field group and what fields you want to display?

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

#2043865

Minesh
Supporter

Languages: English (English )

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

I see there was no entry added for the "Test Repeatable Group". So, first I have added few entry to that group as you can see with the following edit page:
=> hidden link

Then, I've added the view that should query the repeating field group and display its associated items. The view is added under the label "Test Repeatable Group" on the following content template:
=> hidden link

And as I can see now on frontend, I can see its displaying the associated items. Can you please check now:
=> hidden link

#2048765

Thanks, Minesh. I think this is becoming a little clearer now.

So the repeatable required some data to be entered before it could be added to a content template?

I'm now trying to understand the use of forms to edit the entries on the front-end as per the instructions on https://toolset.com/course-lesson/front-end-forms-for-repeatable-field-groups/

I've created Add and Edit forms for the "Test Repeatable Group" but I'm not sure how implement them. I added the edit form to the loop block as per the instructions but it seems to function more like an Add form. Not to mention the need to select the correct "study" rather than editing the current study.

Any advice?

#2051333

Minesh
Supporter

Languages: English (English )

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

So the repeatable required some data to be entered before it could be added to a content template?
==>
If there is no data configured - how come you able to display it?

I would like to know - do you want to add new items for "Test Repeatable Group" or you want to Edit existing items?

#2052365

If there is no data configured - how come you able to display it?
==>
Surely the same as any field on my form - its a template?! There are several fields that are not required, so data may not be present on a particular post but the template still lets me choose where it would go when it is present.

I would like to know - do you want to add new items for "Test Repeatable Group" or you want to Edit existing items?
==>
Both. From the front end. I would like to know how to add new items to TRG, and I would to Edit existing TRG items.

#2052769

Minesh
Supporter

Languages: English (English )

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

So, here is the steps you need to follow to create a Add new item for Repeating field group:
=> https://toolset.com/course-lesson/front-end-forms-for-repeatable-field-groups/#creating-a-form-for-repeatable-field-groups

Here is the steps for Editing existing repeating field group item:
=> https://toolset.com/course-lesson/front-end-forms-for-repeatable-field-groups/#forms-for-editing-values-of-existing-repeatable-field-groups

Can you please try to follow that and let me know where exactly on what step you stuck.

#2058971

I tried these previously and followed the guides through to completion, but I guess my problem is that they don't function in the way that I expect.

Add form:
It asks the user to pick a Study, from either all, or just ones theirs, but no functionality to use the current Study.

Edit form:
Again, same problem as the "Add form" but also, it doesn't then show you the TRG entries for whatever Study you pick in order for you to edit them - so its not an edit form... what am I missing?

#2059331

Minesh
Supporter

Languages: English (English )

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

Can you please share details where you want to display the form for adding new item as well as edit existing item for the repeating field group on what post or content template.

#2060507

I've added them to the Study content template currently. I'd either want them on that page or a opened via a button on the template.

#2061631

Minesh
Supporter

Languages: English (English )

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

So, to select the parent automatically where you added the repeating field group form to add the new item.

I've edit the both Add and Edit repeating field group forms and added the $current as default value as you can see with the following screenshot:
- hidden link
Add form => hidden link
Edit Form => hidden link

If you can see on frontend now:
=> hidden link

If you add a new entry with "Add TRG Form", it will be automatically attached to the current post from where you are adding the entry.

To display the edit form for repeating field group entries, its wise to display first all entries using view with Edit links and display the edit form.

So, i've created a template that holds the edit form for repeating field group:
=> hidden link

And then, I've added the "Edit" post link within the section "Test Repeatable Group" using "Fields and Text" block:
=> hidden link

[toolset-edit-post-link content_template_slug='ct-to-hold-edit-form-for-repeating-field-group' target='blank']Edit [/toolset-edit-post-link]

Can you please confirm it works as expected now.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.