Tell us what you are trying to do?
Hi..:-)..
I have code based on this ticket.. https://toolset.com/forums/topic/display-field-values-from-related-grand-parent-post/#post-1782239
you will see that the code that's used there is working well when displaying value on a page..
[wpv-post-body item="@eyewear-brand-eyewear-collection.parent" view_template="brand-distributor-id-for-eyewear-collections"]
and here's the code from the content template
[types field="id" item="@brand-distributor-eyewear-brand.parent" output="raw"][/types]
It's being used to display values here and you can view it without logging in as there's no condition applied..
enlace oculto
So you can see the distributor ID as 1234 which is the result of the above code.
I need to display the same code but with a condition so I used a view to display the code.. the condition would be based on the result of a short-code.. this short-code is yet to be created.. but first I'd like to check if the working code can be displayed in a loop
[wpv-layout-start][wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-item index=other][wpv-post-body item="@eyewear-brand-eyewear-collection.parent" view_template="brand-distributor-id-for-eyewear-collections"]</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found][wpv-no-items-found]<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>[/wpv-no-items-found][wpv-layout-end]
So you see I am using the same code as above.. but now in a loop and I am displaying it in a content template like this
[wpv-view name="related-brand-distributor-eyewear-collection-brand-distributor-id"]
So it's working fine when I am not using a loop but not when I use it in a loop.
But I need it to work in a loop so that I can create and apply a condition.. why does it not work the same way in a loop?
In the view I've selected 'Eyewear Brands' as the post types to display and added a filter
Select posts in a Eyewear Brands To Eyewear Collections relationship that are related to the Post where this View is shown.
Screenshot attached..
https://toolset.com/wp-content/uploads/tmp/Screen_Shot_2020_09_20_at_8.10.21_AM.png
Please do advise on how I can achieve this so that I can move to the next step of applying a condition to the content of the loop..
Is there any documentation that you are following?
Is there a similar example that we can see?
What is the link to your site?