Skip Navigation

[Resolved] Repeatable Field Groups not appearing in views

This support ticket is created 4 years, 1 month 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 12 replies, has 3 voices.

Last updated by adamG5230 4 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1543503

Tell us what you are trying to do?

I have created a nested group (with many layers inside of more layers) of repeatable groups so i can use them for a template. I have been trying in the block editor to add 'views' of these repeatable field groups, but most of the time the side bar in the 'field source' section doesn't recognize they even exist (so of course there is nothing to link to). I have tried going into the Views section to create individual field groups and those are able to find the repeatable field groups, but when i go back to blocks to use them, nothing appears in the back-end or preview part for content. I have switched over to the classic view where i used input the information into the code directly and that still came up with nothing. I have also tried using these in Elementor and it has the same response, no content is loaded for the specific field type. "No Items Found" is generally what they say.

I have it all connected to my custom post type but I must have clicked on the wrong thing or messed up linking the information some where, but im too new to this to see it.

Is there any documentation that you are following?

I have gone through almost all of your documentation, other peoples problems and questions related to the topic as well as most of the youtube videos trying to figure this out before asking you guys for help.

On what i have constructed of my website on the only page i have, you can see the little side bar shows the "no items found" under the leaf shape. In my template i have more variations of things ive tried but pretty much with the same results.

#1543875

Hi, the block editor doesn't handle nested Views yet so building this structure out completely in the block editor isn't possible now. Instead, you'll need to use the Views editor to create each nested View. My instructions here assume you will start with the outermost / top level RFG View. In general, each View will have one Query Filter for "post relationship or field group owner". If you are editing a View but you cannot see the Query Filter panel, scroll to the top right corner of the admin screen and click "Screen Options". You can enable the Query Filter panel here. In this outermost / top level View you will add/edit a post relationship query filter set to "set by the post or page where the View is shown" if you intend to place this outermost View in a template for the main custom post type, or in the post content of each main CPT post. Otherwise, if you intend to place this outermost View nested in another View of the main custom post type, you will choose "set by the current post in the loop". Now you have set the post relationship query filter context, so the View knows where to look to set the source of the related field group. Next is the output.

Skip to the Loop Output section. For complex designs with many nested Views, it's not always straightforward to know how to set up a table structure that will expand to fit your needs. You may want to just start with an unformatted loop to be sure the correct content is included, then go back and add your markup or use the Loop Wizard to generate it for you. The Loop Wizard can also help you place content that might not be from the current post (or current RFG in a loop), using the Post Selection feature that is also present when you click "Fields and Views".

Let's say you have a table design with 4 columns. In the 4th column, you want to include a nested View. So while you're developing the outer view, just use some example placeholder text in the 4th column. This will be enough to help you get the overall grid established before introducing another level of complexity.

If you are stuck and just need another set of eyes on it, I'll be glad to take a closer look in wp-admin. Please provide login credentials here and let me know where I can see the outermost View on the front-end of the site.

#1543989

Thank you for getting back to me, especially on a Sunday.

Even though its probably not a good thing that Blocks don't do nested views, Im happy to hear you say that, since iv been pulling my hair out trying to figure this out. I guess iv been putting RFGs through the ringer.

To explain my website more, it will be a database for plants and so I really need the toolset functionality to get the site to work.
Here is an example of my nested structure:
->Plant RFG1
------->Common Name FG1
-------------->Leaf RFG2
-------------------->Leaf Shape FG1
-------------------->Leaf Color FG2
------------------------------>Fall Foliage RFG3
-------------------------------------->Fall Color FG1
etc.

Now, specifically im trying to create a template page to show the user the plant they clicked on. In that Plant page each Field Group like 'Common Name' are a stand alone piece so I can customize them individually. I will have all of the leaf content together but each field will be their own view. I hope that makes sense.

I have a couple questions to clarity some things.
1) In this sense the RFGs are just the containers to help organize and hold the field groups, right?
2) Going from what you said, I would put one filter for the "post relationship or field group owner", but what about the deeper fields in this list? For example if I wanted 'fall color' field would i have just the one filter for 'Fall Foliage' RFG or would I have three filters, one for 'Fall Foliage', 'Leaf', and 'Plant'?

#1545991

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Adam,

Christian is currently unavailable today but will be back tomorrow to continue assisting with this ticket.

Thanks,
Shane

#1547077

1) In this sense the RFGs are just the containers to help organize and hold the field groups, right?
I'm not sure I understand completely but yes, RFGs are "containers" that help organize repeatable sets of fields. That's a reasonable conceptual description. A more technical description is that RFGs are basically a custom post type that contains its own fields, and the connection between an RFG and its parent post or parent RFG is handled like a one-to-many relationship.

2) Going from what you said, I would put one filter for the "post relationship or field group owner", but what about the deeper fields in this list? For example if I wanted 'fall color' field would i have just the one filter for 'Fall Foliage' RFG or would I have three filters, one for 'Fall Foliage', 'Leaf', and 'Plant'?
Just the one filter for Fall Foliage, set by the current post in the loop. The other filters are implemented in the higher level RFG Views.

#1549097

Hi Christian,

So followed what you said, but the values are still not showing up. Like last time I really try to figure these things out on my own. I tried so many different combos to try to get it to work and looked up more Toolset guides but nothing is working.

Are you available to take a gander at it?

#1551555

Sorry I'm not available on Fridays but I'll be glad to take a look as soon as possible. Please provide login credentials in the private reply fields here. Also please provide a URL where I can see the Views you've been working on.

#1552213
1.png
2.png
3.png
4.png

Hi, I made a few adjustments and I wanted to post an update for you to follow along up to this point. I was working in the "Family" View here: hidden link

1. Is "Plant" the Post type, or the RFG name, or both? It's confusing, so I recommend changing one of these. Since we are looping over the RFG items in the Family View, I left the RFG Plants selected and unchecked the Post Type Plants. Now this View loops over the items in the Plant RFG.
2. I changed the post relationship filter to find RFGs related to the post where the View is shown. I did this because the View is placed in the Content Template for Plants (the post type Plants). Since the View is shown on a Plant post (in this case Test Maple), the filter should find all the Plant RFGs associated with the Test Maple post, and loop over those items. Also in this picture take note of the limit setting - it's only 1. You may need to change this if you add more RFGs and want to display them in this View.
3. Family is a field in the RFG, so the shortcode to display the family field is simple with no item @reference. I made this change for you in the loop.

[types field='family'][/types]

4. I removed the family field shortcode from the Output Editor panel. The field shortcode should be in the loop, so your View will display the field for each Plant RFG item it loops over.

Please take a look and let me know your thoughts, then we can move on to discussing the Leaf Shape View.

#1552909

Hi Christian,

Thanks for that. I looked through it and generally made sense to me. Of course im still learning so im sure my understanding will become better.

1. I agree with you, the Plants CPT and Plants RFG is way too confusing and problematic. A plant post should not have multiple plants in it. I will get rid of Plants RFG, so does that mean the 'Family' should be checked in Plants CPT from now on?
2. I went on and tried my hand with Leaf Shape View and it worked wonderfully. I also added two more different types of views. 'Hardiness Zone' has the zones of both Cold and Hot inside and all I had to do was add a dash or 'to' to divide them. easy.
3. I also added Common Names View which can have multiple names and should be divided by a comma. I could get the multiple names but not how to divide them by a comma. I tried several things including referring to a post you helped someone with (https://toolset.com/forums/topic/question-about-filter-option-values/), but still no luck. How do you add a comma to multiple values that are not numbers?

Overall, great success! Progress!

#1554093
Screen Shot 2020-03-17 at 4.59.10 PM.png

I will get rid of Plants RFG, so does that mean the 'Family' should be checked in Plants CPT from now on?
I'm not sure I understand what you mean by "should be checked in Plants CPT"...are you talking about one of the checkboxes in the View editor screen? Could you clarify a bit please?

If you get rid of the Plants RFG but plan to maintain all the same information, then it seems that the top level fields and top-level RFGs from the current Plant RFG model would move into the Plants CPT itself:
- Family
- Genus
- Species
- Common Name RFG
- Cultivar/Variety RFG
- General RFG
- Leaves RFG
- Flowers RFG
- Fruits RFG
- Stems RFG
- Roots RFG
Is that what you're talking about?

How do you add a comma to multiple values that are not numbers?
I see, you're creating a View that loops over Common Names, which are simple text fields in an RFG. The easiest way to set this up is to click the Loop Wizard button above the Loop editor panel and choose the format "List with separators". I'm attaching a screenshot here. In the next popup screen you will choose to insert a comma as the separator, and the Loop Wizard will handle everything else.

This document has more information about the different predefined loop styles offered in Views:
https://toolset.com/documentation/user-guides/views/view-layouts-101/
...and this document is critical for understanding the syntax and different components in a View's loop:
https://toolset.com/documentation/user-guides/views/digging-into-view-outputs/

#1554107

Yeah sorry about that. In the View editor in the 'Content Selection' area you can check post types or repeating field groups. Before in Family you checked Plants repeatable field group but since it will no longer be in a repeating field group I should just check the Plants post type instead, correct? Im basically just making sure I don't mess up everything.

I had a feeling it would be right in front of my face. Thanks that helps a lot.

#1554159

Yes, you will select the Plants post type in the Content Selection area. You might mess up everything by moving these fields around out of the Plants RFG, but you could start a new test Plant post and abandon the Test Maple post since it will have an outdated data structure.

#1554179

Fantastic. That definitely fixed my issue. Thank you!

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