Skip Navigation

[Resolved] Repeatable Field Group View Showing Blank Rows

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
- 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 12 replies, has 2 voices.

Last updated by Shane 4 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#1811755

Hi Toolset, I have a view where I am displaying repeatable field groups and the post ID which is the owner of the field groups. I am noticing many blank rows that might be caused because I do not have a query filter or in the past, I have used repeatable field groups.

Video: hidden link

Here is my View Set-Up:

Search:

[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="filter-container">
<div class="backcolor">
<div class="flex-container">
<div class="form-group">
<label for="wpv-wpcf-document-type">[wpml-string context="wpv-views"]<b>Type:</b>[/wpml-string]</label>
[wpv-control-postmeta type="multi-select" field="wpcf-document-type" url_param="wpv-wpcf-document-type"] <center> [wpv-filter-spinner spinner="hidden link"][/wpv-filter-spinner] </center>
</div>
<div class="form-group">
<label for="wpv-wpcf-document-source">[wpml-string context="wpv-views"]<b>Source:</b>[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-document-source" type="multi-select" url_param="wpv-wpcf-document-source"] <center> [wpv-filter-spinner spinner="hidden link"][/wpv-filter-spinner] </center>
</div>
<div class="form-group">
<label for="wpv-wpcf-document-date_min">[wpml-string context="wpv-views"]<b>Date Min: </b>[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-document-date" url_param="wpv-wpcf-document-date_min"]
<br>
<label for="wpv-wpcf-document-date_max">[wpml-string context="wpv-views"]<b>Date Max: </b>[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-document-date" url_param="wpv-wpcf-document-date_max"] <br> <center> [wpv-filter-spinner spinner="hidden link"][/wpv-filter-spinner] </center>
</div>
</div>
</div>
<div style="float:left;">[wpv-filter-reset reset_label="**Reset**" output="bootstrap" class="reset"]</div> <div style="float:right;">[wpv-filter-submit name="Search"] </div>
</div>
<br>
<br>
[/wpv-filter-controls]
[wpv-filter-end]

Loop:

[wpv-layout-start]
[wpv-items-found]
<div class="table-container">
<label>Results Below</label> <label style="font-style:italic">(table & map):</label> [wpv-found-count]<br>
<label>Showing [wpv-items-count] per page</label>
[wpv-pager-nav-links output="bootstrap" first_last_links="true" previous_next_links="true" reach="4"]
<!-- wpv-loop-start -->
<table width="100%">
<thead>
<tr class="backcolor">
<th style="width:9%">[wpv-heading name="post-id"]Post ID[/wpv-heading]</th>
<th>[wpv-heading name="types-field-document-type"]Document Type[/wpv-heading]</th>
<th style="width:9%">[wpv-heading name="types-field-document-source"]Document Source[/wpv-heading]</th>
<th style="width:9%">[wpv-heading name="types-field-document-date"]Document Date[/wpv-heading]</th>
</tr>
</thead>
<tbody class="wpv-loop js-wpv-loop">
<wpv-loop>
<tr>
[wpv-post-body view_template="loop-item-in-2020-10-14-document-report"]
</tr>
</wpv-loop>
</tbody>
</table>
<!-- wpv-loop-end -->
[wpv-pager-nav-links output="bootstrap" first_last_links="true" previous_next_links="true" reach="4"]
</div>
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

Loop Editor

<td>[wpv-post-id item="@document-report.parent"]</td>
<td>[types field='document-type' separator=', '][/types]</td>
<td>[types field='document-source'][/types]</td>
<td>[types field='document-date' style='text' format='m/d/Y'][/types]</td>

#1812541

Shane
Supporter

Languages: English (English )

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

Screenshot 2020-10-15 at 9.45.58 AM.png

Hi Andrew,

Thank you for getting in touch.

It should be noted that there is a notice on the View itself that mentions that you should add a post relationship filter. See Screenshot for the text highlighted in blue.

Once you've added this post relationship filter then your view should filter correctly. However in your video you mentioned that it doesn't work.

Can you send me a screenshot of the settings that you are using for this post relationship query filter.

Finally it should be noted that because of your other filters it can lead to a no results found. So I would recommend removing the other filters and just add the post relationship filter to see if this produces a result.

Thanks,
Shane

#1812639
Screen Shot 2020-10-15 at 8.25.55 AM.png
Screen Shot 2020-10-15 at 8.24.22 AM.png
Screen Shot 2020-10-15 at 8.24.08 AM.png

Hi Shane,

I've tried the following query filter settings with and without the other filters. Please see my screenshots. I've tried all the other ways as well but just did not include their screenshots below.

I am wondering if I am supposed to click posts and repeatable field group under the content selection? Right now I only have my repeatable field group selected... but I have been trying a mixture of these settings and have not gotten them to work.

Additionally in the loop editor I have "<td>[wpv-post-id item="@document-report.parent"]</td>" which shows the parent post ID of each repeatable field group.

Please let me know maybe what else I am missing.

#1812665

I tried also having posts selected under the content selection and still showing no results.

#1812679

Shane
Supporter

Languages: English (English )

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

Hi Andrew,

Would you mind allowing me to have admin access to the site as well as a link to the page where you are testing this so that I can have a more detailed look.

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

#1812769

Hi Shane, yes no problem. Just keep in mind that this is my live site with customers active, but you are good to make changes.

Thank you,
Andrew

#1812869

Shane
Supporter

Languages: English (English )

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

Hi Andrew,

I took a look at the site but i'm not able to check the post itself as the user role doesn't allow me to edit your TEst post to check for the repeatable fields.

Can you change the role to admin .

Thanks,
Shane

#1813007

Hi Shane, will do, it is now set to Admin

#1813017

Shane
Supporter

Languages: English (English )

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

Hi Andrew,

So the view is setup correctly, however in order for it to show the relational data it must be placed on a post that is displaying its parent.

In this case the view must be added to the Post template. Adding it to this test post page won't produce any results. It will need to be added to the post that has a repeatable field group added.

Example you should place the view on the elementor template for posts and it should display the RFG data of the current post being viewed if there is any.

Thanks,
Shane

#1813081

Hi Shane, I see

Is there any other way to get a view of the repeatable field groups with their associated posts in a table view? Like all of them listed in one table? I thought I was able to do something like that with no blank rows a while back, but I just forgot how I did it.

If nothing else possible, another solution is, how would I display only the repeatable field groups in a table (like I have now) but with no post association or blank rows? What settings do I need to have to achieve this one?

Thank you,
Andrew

#1813883

Shane
Supporter

Languages: English (English )

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

Hi Andrew,

The only way you will be able to do this is to do a nested view setup, where the Parent view will list out the actual posts and the Child view will list out the repeatable fields.

So what you need to do is to Create that parent view and add this Repeatable fields view inside the loop tags or content template of the Parent view.

Then set the relationship filter to get its data from the Parent view.

Finally just add your parent view to the page that you want it to be on and it will list out the posts and the associated RFG of each post.

Thanks,
Shane

#1814431

Hi Shane,

I understand what you are saying. The only bad part about having the posts be the parent is I will not be able to filter by the child fields (repeatable field groups) on the parent view as the parent view is only showing the posts and only "nesting" in the RFG. This has been my experience that you cannot filter a nested view in the parent. Am I correct in this?

I went ahead and did as you said except with being able to filter by the RFG in mind, I made the RFG as the parent and the post as the child "nested" view. This worked, however, I still get blank rows. Do you know why this might be if I am only displaying repeatable field groups? It doesn't make sense to me because why would blank rows show up if I am only displaying filled in data?

Here is a video showing in better detail.

Video: hidden link

Thank you for your help! I hope you have a great weekend.

- Andrew

#1819053

Shane
Supporter

Languages: English (English )

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

Hi Andrew,

So the reason why the items are showing blank is because of these fields here.
<td>[types field="document-type"][/types]</td>
<td>[types field="document-source"][/types]</td>
<td>[types field="document-date"][/types]</td>

Do all of the posts that are being listed have these fields filled out ? If not then they will show blank. This is because the post itself still displays in the loop but only the items from that post will display.

What you can do is to use our conditional code to check if the field is NOT empty and then display it. So you would essentially use the conditional button in your view and warp your entire code below in a conditional statement checking if they are not empty..
<td>[types field="document-type"][/types]</td>
<td>[types field="document-source"][/types]</td>
<td>[types field="document-date"][/types]</td>

Please let me know if this helps.
Thanks,
Shane