Skip Navigation

[Gelöst] Help in setting a front-end form for repeatable field groups

This support ticket is created vor 2 Jahre. 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.

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 23 Antworten, has 3 Stimmen.

Last updated by Minesh vor 2 Jahre.

Assisted by: Minesh.

Author
Artikel
#2325937

Sorry but this is not something regarding our setup...
Question is simple: is it possible to have, in a FRONTEND form, that kind of repeater ( for any RFG ) that you find in backoffice when you edit the single CPT page? (check my previous screenshot, please)
Why is it possible to have in backoffice and not in frontend? With that repeater you avid the need to create various forms, templates, view ecc. just to edit a RFG group.
With a single repeater (so a single field) you can: ADD, EDIT and REMOVE.

#2325965

Minesh
Supporter

Languages: Englisch (English )

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

You can not combine the post form and the repeating field group form in a single form like backend, you can say that's a limitation or how it works for frontend.

For instance:
- You have post type "Student" having 10 custom fields
- You have repeating field group "Social information" having 3 custom fields and this repeating field group is set to display with post type "Student"

Now, as you noticed, its possible to edit both Student post itself as well as repeating field group both as the same time when you try to add/edit the single post of "Student" post type from backend but the same is not possible for frontend.

That is why this detailed Doc comes in the picture:
- https://toolset.com/course-lesson/front-end-forms-for-repeatable-field-groups

Even I shared with you working demo, how you can set it up.

There are multiple ways you can setup its based you different requirement and where you want to place the edit form. In your case, you want to first list all repeating field items with ADD, EDIT and REMOVE, so you will have to create a view (in classic mode) so that we can list all repeating field items on different page when we click on "Edit prices list" link from the single post.

I already shared detailed steps and you have all control over there with the test site I created for you:
=> https://toolset.com/forums/topic/help-in-setting-a-front-end-form-for-repeatable-field-groups/#post-2324019

I'm not sure where exactly you stuck yet and if you do not want to share your site, we can work on the test site I shared and you can share details where exactly you want help with and then you should try to replicate the same on your site.

We are here to help. I offered you all possible options and you will have to decide. Thank you 🙂

#2330337

Hello,
here i am again, i followed your example and added with success the RFG list and edit page.
What we need now is to print the title of the related post, for example in your link hidden link under the title we would like to print the related post title ("It’s windy" in this case).
How can this be done?

Thanks

#2330345

I forgot: could you please update your demo in order to add a "add new" form form that RFG?
Thanks a lot.

#2330575

Minesh
Supporter

Languages: Englisch (English )

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

I've created the following form to add new RFG entry:
=> hidden link
[where with the parent field I've set the parent field's default value to be coming from the URL param. Please check the following screenshot: hidden link ]

This is how I've added the parent title:

<h1> [wpv-post-link item="[wpv-search-term param='wpv-relationship-filter']"] </h1>

And this is how I've added the form to add new entry for RFG:

<h1> Add RFG Entry </h1>
[cred_form form="add-rfg-form"]

=> hidden link

Now, on this page: hidden link
- You will see a form to add new entry as well as parent title. When you submit the new entry it will automatically populated in the below table that lists RFG entries.

#2332145

Thank you!
One last thing (i hope...) about getting the title with [wpv-post-link item="[wpv-search-term param='wpv-relationship-filter']"]:
This is working well, so we get the post title of the CPT ROOM.
Now we a relationship with the CPT HOTEL, so a single hotel can have more than 1 rooms and avery room is owned by just one hotel.
What we need is print the hotel name, so we will have: HOTEL NAME > ROOM NAME.
Is this possible?
Thanks a lot!

#2332207

Hello again, we ran in another problem...
When you click an edit button for the RFG for the row you want to edit, the page load and show the edit form, problem is when in the single CPT post type you add a featured image, the same image is shown in that edit page!

I have added the featured image in your demo so you can see the problem here: hidden link

#2332533

Hello,
i have managed to remove the featured image in the RGF edit form by going here hidden link and Disable Featured Image in Elements > Featured Image > disable.

Anyway... why using that page for the edit form instead to use the same page where the RGF is listed?
I mean, when you go here hidden link you see the page title "Edit RFG items page", the related page title "It's windy" and the form with the title " Add RFG Entry".
Is it possible to change the single row edit button link url by pointing to the same page plus the cred_rfg_id?
for example hidden link

If so, is it possible to use a conditional in order to use the "add form" or the "edit form" based on the existence of the cred_rfg_id variable in url query string?

Thanks

#2333407

Minesh
Supporter

Languages: Englisch (English )

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

Edit for will require container to hold the form. It will make things too complicated for you later. I suggest you keep add and edit form on separate pages in order to make sure there will be no conflict.

As per our support policy we entertain only one question per ticket, however we build a full functional module to list, add, edit, delete the RFG from frontend. I suggest you open a new ticket with every new question you may have. This will help other users searching on the forum as well as help us to write correct problem resolution summery for the original issue reported. Thank you for your understanding.

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