Sauter la navigation

[Résolu] Display field values from related grand parent post

This support ticket is created Il y a 4 années et 3 mois. 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

Ce sujet contient 2 réponses, a 1 voix.

Dernière mise à jour par AlimB3245 Il y a 4 années et 3 mois.

Assisté par: Jamal.

Auteur
Publications
#1782077

Tell us what you are trying to do?

I have a a post Eyewear Collection. it's parent is Brand... the parent of the Brand is Brand Distributor.

from an Eyewear collection post I was able to get the post title using a documentation (a link to which I can't find anymore).. here's the code

[wpv-post-body item="@eyewear-brand-eyewear-collection.parent" view_template="brand-distributors-for-eyewear-collections"]

I was clear upto then but I would appreciate if you could help me with the link for documentation for this so that I can revisit and see what I had done..;-)..

And now my query.. with the above line I am not sure how I am getting the post-title.. I am assuming that's what is defined in the template.. and now I have certain fields in the post that I need to get .. how do I do this..

I tried the below code by tweaking the above from wpv-post-body to fields but it didn't seem to work ..

[types field="notification-email" item="@eyewear-brand-eyewear-collection.parent" view_template="brand-distributors-for-eyewear-collections"] [/types]

I am sure the above line is not what I should be doing but I hope you get an idea of what I am trying to achieve.. it's a 'notification-email' custom field from the grand parent post

At the link below you will see the name 'Ronak Optik India Pvt Ltd'.. this is the post-title of the grand parent of this post.. I need to get other fields..

lien caché

Please do help me with this..

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site? lien caché

#1782239
Screen Shot 2020-09-19 at 4.21.46 PM.png

Hi

I managed to figure this out.. this actually trying to break up a very complicated ticket I had earlier where I was totally confused as a simple requirement got too complex for me.. so maybe it is complex but I'd rather understand it step by step..

So first I'd appreciate if you could send me the page to where this link earlier used to go..
https://toolset.com/course-lesson/displaying-related-posts/#3-create-a-content-template-that-displays-grandparent-information

I remember some of the content and it doesn't seem to be the same content.. but based on some help I had from Minesh I have done this..

I needed 4 fields.. so i created 4 content templates and added these lines to them

Name

[wpv-post-title item="@brand-distributor-eyewear-brand.parent"]

ID

[types field="id" item="@brand-distributor-eyewear-brand.parent"][/types]

Email

[types field="notification-email" item="@brand-distributor-eyewear-brand.parent"][/types]

Mobile

[types field="notification-mobile" item="@brand-distributor-eyewear-brand.parent"][/types]

Then to call all of them on the Eyewear Collection Page

I did this..

<h4>Distributor Name</h4>
[wpv-post-body item='@eyewear-brand-eyewear-collection.parent' view_template='brand-distributor-name-for-eyewear-collection']</br></br>
<h4>Distributor ID</h4>
[wpv-post-body item='@eyewear-brand-eyewear-collection.parent' view_template='brand-distributor-id-for-eyewear-collection']</br></br>
<h4>Distributor Email</h4>
[wpv-post-body item='@eyewear-brand-eyewear-collection.parent' view_template='brand-distributor-notification-email-for-eyewear-collection']</br></br>
<h4>Distributor Mobile</h4>
[wpv-post-body item='@eyewear-brand-eyewear-collection.parent' view_template='brand-distributor-notification-mobile-for-eyewear-collection']

And then I got this result
https://toolset.com/wp-content/uploads/tmp/Screen_Shot_2020_09_19_at_4.21.46_PM.png

You should be able to see it here unless it's been updated.. lien caché

So this is all I needed as STEP 1 to understand and so I will close this ticket and start STEP 2 as another ticket to keep things simple and structured..:-)..

Regards,
Alim

#1782283

My issue is resolved now. Thank you!

I have moved to the next part of this issue and here's the ticket

https://toolset.com/forums/topic/separate-multiple-values-in-a-wpv-post-body-output-with-a-comma/

Regards,
Alim