Skip Navigation

[Résolu] Help with Nested Views and Post Relationships

This support ticket is created Il y a 4 années. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 2 réponses, has 1 voix.

Last updated by Gavin Il y a 4 années.

Auteur
Publications
#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!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.