Skip Navigation

[Resolved] Help with Nested Views and Post Relationships

This support ticket is created 4 years, 10 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 2 replies, has 1 voice.

Last updated by Gavin 4 years, 10 months ago.

Author
Posts
#1551307

Hello. My brain is aching and I need a wee bit of help...

I have two CPTs (DATE) and (ITEM) in a many-to-many Relationship with an intermediary CPT (ITEM-TO-DATE).

The intermediary CPT has a numerical custom field called QUANTITY:

For a DATE I wish to list all the ITEMs in the ITEM-TO-DATE relationship. Easy.

Then for an ITEM I wish to get the QUANTITY numerical value from ITEM-TO-DATE but only for the ITEM's parent DATE.

For example:

If I nest a View within a View for a DATE:
VIEW 1 - List ITEMs in the ITEM-TO-DATE relationship
VIEW 2 - List ITEMS-TO-DATE related to current post in loop
Display QUANTITY

It displays QUANTITYs for all ITEMS-TO-DATE related to the ITEM. I just want the one QUANTITY for the original DATE.

Thanks.

#1551313

Okay... Think I might have solution...

VIEW1 - List ITEM-TO-DATEs in ITEM-TO-DATE relationship as related to post where view is shown
Get the QUANTITY and pass as an argument to the nested View...
VIEW2 - List ITEMs in an ITEM-TO-DATE relationships related to post where view is shown
Display the QUANTITY

#1551429

All sorted. Phew!