Skip Navigation

[Resolved] Repeatable regions loop is adding empty items

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here was that the user's view was adding empty items to their loop on the frontend

Solution:

The reason for this was that the user had also selected another CPT on their view which did not have the custom fields that they were displaying.

This had caused the view to display an empty div whenever data for that CPT is to be displayed.

This support ticket is created 5 years, 4 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by kristofG 5 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1281987
Screenshot_5.jpg
Screenshot_4.jpg
Screenshot_3.jpg

I am using these repeatable regions for the very first time trying to create a restaurant menu with dishes and prices.
I notice in my loop for the aperitieves, that although I have 1 item with 3 fields, there are 3 empty fields in front of that.

#1282015

Shane
Supporter

Languages: English (English )

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

Hi Kristof,

Thank you for getting in you for getting in touch.

Could you ensure that the item that you are displaying doesn't have the custom fields that the Types shortcode is referencing blank?

If these fields are not populated then they will show up as empty on the frontend.

Thanks,
Shane

#1282145
Screenshot_6.jpg

Hi Shane,
I had to read your answer a few times, but i am afraid it don't quite understand what you are saying.
I have added another screenshot where you can see that for "aperitieven" there are no blank fields.
This issue is not present for "voorgerechten", even though I duplicated the first view to create the "voorgerechten" view.

On a sidenote, is this the best way to create a restaurant menu? Creating 1 CPT "Menu" with repeatable regions and then creating different views for aperitieves, starters, mains, desserts?

#1282189

Shane
Supporter

Languages: English (English )

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

Hi Kristof,

Would you mind if I checked this out for you first hand ?

I've enabled the private fields for your next response.

Please also link me to the page that this issue is on.

Also yes this is a good way to create your menu items for a restaurant

Thanks,
Shane

#1282311

Shane
Supporter

Languages: English (English )

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

Hi Kristof,

The issue was that you were displaying the Menu CPT along with the specific menu items as well. That is why the empty items were being displayed as well.

Thanks,
Shane

#1283175
Screenshot_7.jpg

Ok, brilliant, that fixed it. As I said, this is the first time I am using Repeatable Groups.
I have another issue where I added a second repeatable group to a Post Fields Group when I realised I'd better create a 2nd Fields Group for that new repeatable group, so I deleted that repeatable group from the first Fields Group, created a second Group and inserted the repeatable group again, but the system now says that that slug for the repeatable group has already been used, even though I cannot find that group anywhere.
It is also visible in my View, where "voorgerechten" is the old repeatable group and "voorgerechten2" is the new one. How do I delete the old one?

New threads created by Shane and linked to this one are listed below:

https://toolset.com/forums/topic/split-repeatable-regions-loop-is-adding-empty-items/

#1283273

Shane
Supporter

Languages: English (English )

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

Hi Kristof,

Given that we have resolved the original issue in the thread, I'm going to split this one into a new thread.

You can go ahead and mark this one as resolved as we handle the other issue in the next thread.

Thanks,
Shane

#1283307

My issue is resolved now. Thank you!