Skip Navigation

[Resolved] Nested View [wpv-found-count] for child view

This support ticket is created 2 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.

This topic contains 1 reply, has 1 voice.

Last updated by TomW5440 2 years, 4 months ago.

Author
Posts
#2429507

Tell us what you are trying to do?

I have 2 views nested within each other (agent, child). The parent view has been created in classic view (so I can nest the views) and child created in block editor.

That parent view query filter is set to display author posts with author same as logged in user and the child view query filter is set to display property posts with author same as logged in user.

This seems to work until I add a conditional with [wpv-found-count] because it's counting the parent view and not the child which is what I need.

The conditional variables are property_count which belongs to parent view and [wpv-post-count] but this needs to be the child count.

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-title]

[wpv-view name="agent-properties-copy-1658823653"]
[wpv-conditional if="( $(wpcf-property-count) gt '[wpv-post-count]' )"]
[types field='property-count' format='FIELD_VALUE'][/types] here [wpv-found-count]
[/wpv-conditional]

</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]

Is there any documentation that you are following?
https://toolset.com/documentation/legacy-features/views-plugin/using-a-child-view-in-a-taxonomy-view-layout/
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-items-found

Thanks for listening.

#2429523

My issue is resolved now. Thank you!