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?
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).
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.
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.
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
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.
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?
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.
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?
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.
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