Accueil › Toolset Professional Support › [Résolu] Help in setting a front-end form for repeatable field groups
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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
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)
Ce sujet contient 23 réponses, a 3 voix.
Dernière mise à jour par Minesh Il y a 2 années et 7 mois.
Assisté par: Minesh.
Hello,
i followed this tuorial in order to add a frontend form for a repeatable field group: https://toolset.com/course-lesson/front-end-forms-for-repeatable-field-groups
We need this to edit existing values, added in backoffice.
Problem is in this part:
4) Create a new page and insert a new View Block into it. Follow the View creation wizard and in the step for selecting the content to display, select your repeatable field group.
Our repeatable field group is not listed there.
Some info:
Our post type is: camere
Our RFG appears on Post Type(s): camere | Template(s): Camere Content (ANY condition)
Maybe we made some wrong step?
Les langues: Anglais (English ) Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
Hi there
It looks like there is a problem with that course lesson.
Repeatable Field Groups (RFGs) are only offered as a content source in the View wizard when the View itself is being inserted in the context of the post type the RFG belongs to, e.g. in a Content Template for that post type.
So if you have a Content Template for the post type, you can insert a View to show the RFGs belonging to the current post displayed with the template, and you can insert the edit post form in the output of that View.
I'll contact the documentation team and ask them to update the lesson.
Thanks.
So our first error was to have created a simple page in order to add that new view.
That's why we cannot see the RFG...
Anyway, it is no clear how we can get the result we want..
Ok i try to explain what we want to achieve:
We have a CPT Camere, we have build a content template with a post form where our customer can edit all info of the single cpt, and this is working well. Problem is that this form cannot contain (obviously) any RFG field.
So we build another post form by following that guide but... what now?
How can this form appear on frontend? Our idea is to add a link "edit this rfg" on top of the single post cpt frontend.
So, as suggested, you will have to create a view to display the repeating field group entries and with every entry you should display a Edit link to edit that specific repeating field group item.
Please check the following Doc and try to follow the steps given with the following link:
=> https://toolset.com/course-lesson/front-end-forms-for-editing-content/?#adding-an-edit-link-to-a-list-of-items
Ok... sorry but this bring us to the main problem:
i followed this tuorial: https://toolset.com/course-lesson/front-end-forms-for-repeatable-field-groups
we created a new page and start adding a new View Block into it, we follow the View creation wizard and in the step for selecting the content to display there is no repeatable field group to be chosen.
Again, our repeatable field group is not listed there.
Other question: this new view, in which CPT should be created?
first thing is, where you want to display list of repeating field entries with "Edit" item link? On the same single post content template for post type "camere"? if yes:, you can create a view to list repeating field entries on content template that displays the single post of post type camere. When you create a new view, it should offer you the repeating field group to select as content selection.
Please correct me if I'm wrong and if its too hard for you, please share details where exactly you want to display the repeating field group entries with edit link and share problem URL and admin access details and I'm happy to help you out there.
*** 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.
"first thing is, where you want to display list of repeating field entries with "Edit" item link?"
Not correct (at least for now, i think that this is a next step).
(screenshot 1):
We are in frontend single page for CPT Camere. This page show the content of the room, if an administrator (or any role that can edit the content) is logged, it can see the link "edit content" (his link open a frontend page that show the form with all needed fields, this is working well).
What we want is: near the link "edit content" we need to add another link called, for example, "edit the price list".
This new link should open a page that show the editable form for managing the RFG content.
(screenshot 2):
This is the RFG
(screenshot 3):
This is the Edit Post Form connected to the RFG "Stagioni e Prezzi Camere"
So, for that what you will have to do is, create a new page: Edit Price List
- The link you construct "edit the price list", you will have to pass the current post ID as URL param. If you can share admin access details with me I can quickly demonstrate you. Is it possible for you to send me admin access details?
Otherwise I will try to setup a test site.
*** 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.
We already tried to add a new page "Edit price list" but when adding the view, no RFG appear on field list.
Colud you setup a test site fo us? Thanks a lot for the professional support.
Here is the test site, you can auto-login with the following link:
=> lien caché
As you can see with the following post, there are three repeating field items available under repeating field group "outfit-infos":
=> lien caché
I've created the following edit form to edit the existing RFG entries:
=> lien caché
I've created the following view in classic mode as in block mode the RFG is not available for selection (strange):
=> lien caché
- within the above view, I've added the post-relationship query filter under the "Query Filter" section:
Filter by post relationship or repeatable fields group owner Select items from the outfit-infos group that are related to the Post with ID set by the URL parameter wpv-relationship-filter. eg. <em><u>lien caché</u></em>
- within the loop output I've added directly the edit form:
<div style="padding-bottom:25px;"> [cred_form form='edit-rfg-form'] </div>
Now, I've created the following page that will display the RFG items to edit and added the above view using "Fields and Text" block:
=> lien caché
And, on content template that displays the single post, I/'ve added the "Edit link" using the "Fields and Text" block at bottom of the following content template:
=> lien caché
<a href="/edit-rfg-items-page/?wpv-relationship-filter=[wpv-post-id]"> Edit RFG </a>
Now, if you go to the following post where RFG entries are available, you will find the "Edit RFG" link at bottom of the page:
=> lien caché
Once you click that, you will be redirected on the page where you can edit the RFG items:
=> lien caché
You can follow this steps to achieve the same on your install. I hope this helps 🙂
Ok thanks, i will get a try asap.
About the form here lien caché, why is edited in expert mode? Maybe something does not work in the other way?
About lien caché
I thought to find there the same repeater of the backoffice that can permits to add o remove values...
Our customer must be able to edit, sort, add and delete... Sorry, i I thought to find a different field.
How can this be achived? Thanks a lot.
Please check now how view is configured:
=> lien caché
- The view's purpose is changed to "Display results with pagination" from the screen options available at top right.
Please check the following screenshot:
-- lien caché
- You can add the sorting controls from "Search and Pagination" section.
=> https://toolset.com/documentation/legacy-features/views-plugin/allowing-visitors-to-sort-the-front-end-results/
- You can add delete link using the shortcode: [cred-delete-post action='trash' onsuccess='self']Delete[/cred-delete-post]
- For edit link, you will have to create a content template from Toolset => Content template and add your edit form to this content template. In this case, I've created the following content template which holds the edit RFG form:
=> lien caché
- Then, You can add the post edit link using the shortcode: [toolset-edit-post-link content_template_slug='ct-to-hold-edit-form' target='self']Edit[/toolset-edit-post-link], you can add this shortcode from "Toolset Forms" button available with your editor and then click on the "Edit post llink" button and select the content template which holds the edit RFG form.
Please check how it looks like now:
=> lien caché
I hope this is clear now. 🙂
Hello,
thanks for this demo and all the time you have spent to do this but.... why is so complicated "replicate" the same repeater field that appears in backoffice when you edit the single CPT page? (screenshot attached)
I can not say anything until I can review how you setup the things on your site.
If you can share problem URL where you want to display the Edit link and then what page you created to display the repeating field group entries?
I will require admin access details and test post URL where I can review your settings.
*** 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.