Skip Navigation

[Resolved] Unexpected results when displaying related content in nested Views

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

Problem:
I see unexpected content in the output of nested Views, more, or fewer entries than I expected are displayed.

Solution:
Likely the query filter of the nested view is not specific enough.

For example, you could be querying for related content in "any" relationship, which would produce eventually more results than expected in the nested view, versus specifying the exact relationship you want to get the content from, by for example setting the query to "Select items from the [related type] that are a related to the current post in the loop"

This support ticket is created 4 years, 11 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Beda 4 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#1439413
Screenshot 2020-01-04 at 11.45.46.png
Screenshot 2020-01-04 at 11.39.38.png
Screenshot 2020-01-04 at 11.34.31.png

I am trying to: I am trying to create a nested view that shows CF Groups For CPT that i've already created with toolset.
The CPT (packages) contains Title and then values from a repeatable field associated with the specific CPT.

The Issue here is that the view is adding an extra empty item for each repeatable group views.

Note: I've No empty fields.
Also this problem doesn't show in singe view : test page (hidden link) (Only in nested views)

Link to a page where the issue can be seen: hidden link

#1439627
Bildschirmfoto 2020-01-04 um 18.26.09.png
Bildschirmfoto 2020-01-04 um 18.29.02.png

I think it is this line that is problematic in the nested View:

<p  class="package-color plan-title"> [types field='quota-name'][/types] <p>

Since you select posts in "Any relationship that are related to the current post in the loop", and not the explicit posts that are connected to the RFG (repeatable field group),
I think changing the query filter there, to Select items from the Package Description group that are a related to the current post in the loop, will solve the issue.

If it doesn't, I think I'll need (if this happens as well with other themes or no other plugins) a copy of the site to check better, or access to an online development site.

#1439649

My issue is resolved now. Thank you!

#1439673

Great to know this was to the point 🙂