Skip Navigation

[Resolved] can some please continue this ticket.

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to display their child post information on their parent post.

Solution:

To do this I would recommend taking a look at the link below.

https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/

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

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 17 replies, has 3 voices.

Last updated by martinP-13 5 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1195340
#1195417

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Martin

Waqar is away until Wednesday. I'll be happy to help out, but I see that there is a long history of support, not just from Waqar, and I'll need some background to understand the context of your problem.

Could you summarise the post types and their relationships, and the specific content you are having problems displaying?

#1195480

i have my single event pages like this hidden link
this page shows my results via views it uses hidden link php with the shortcode <?php echo do_shortcode( '[wpv-view name="view-to-show-all-dogs-related-to-an-event"]' ); ?> on line 109.

i then have my single-judge page hidden link which shows all related evensts to that judge.

i then have my single-dog page hidden link showing all related juddges and dogs etc.

i have single-owner that i want to show all the dogs they own and the events theose dogs where in along with all other relevant items. basically its the same on all pages less the info for the page you are on

so on a single-owner page
i want to show
a) all dogs in a relationship to the owner.

then under each dog i want to display
a the stake of the event
b)all events related to that dog
c)the position it got in that event
c)the judges for that event
d) the sire and dam of the dog
e) the handler of the dog
f) the breeder of the dog
if you view the a above pages that are complete it will make sense,to display this stuff i have a parent and a child view as so
parent hidden link
child hidden link
i will be at my computer all affternoon if you require any more info fro myself nigel,
thankyou

ive been trying to do this for a week now,going around in circles with support , if you cant help can you reassine to some one who can help me complete this today?

#1195495

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I'm just about to finish, so I will ask Shane to help you (you have previously rejected support from Christian who is the other supporter working in the later timezone).

#1195496

thank you nigel.

#1195557

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Martin,

Nigel assigned this ticket to me, however I would need to go through the ticket history to fully understand this issue.

Will post a response once i'm up to date.

Thanks,
Shane

#1195585

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Martin,

I think I have an idea of what you want to achieve now.

So its Owner -> Events -> Position -> Judges -> Dog -> Handler -> Breeder

This is quite a complex relationship we have here.

However in order to get your desired results your view must be nested in that order and your events must be related in this order.

Thinking about this Many to Many setup is quite extensive but to get your results this is how we should proceed.

Or We have the owners relating to the dogs directly.

Which Would be

Owners page
-> Lists dogs of that owner.
-> Events being a child of CPT of Dogs.
-> Dogs participate in Events
-> Events has positions,
-> Positions belong to Events.

ETC

This is how i'm also looking at it. So a View in this relational order should also give the desired results. Remember that the Parent will determine what the child will display. So its a subsequent nesting of each child view with their immediate parent.

Please let me know if this helps.

Thanks,
Shane

#1195586

sounds right , but not got a clue ,if i get you ,i need 1 parent any many childs?
i started like this but as you see here it is showing no events and 3 sires(a dg can only have 1 sire(father)
hidden link

#1195591

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Martin,

Ok lets use this post as our example.

So right now it is displaying the Correct Dog. This is correct.

So we've already achieved
a) all dogs in a relationship to the owner.

Now we want to display
b)all events related to that dog

However this dog
hidden link

Is not related to any event. I See there is an Event CPT attached to this dog. Is this Event different from the Owners Event CPT ?

Please let me know.

Thanks,
Shane

#1195609

i must of deleted that dog from the event i had it in by mistake in the confusion!! now it takes shape!!
dog is attached to this event now hidden link.
as you see lots of info now there on the owner page! hidden link
all i need now is the stuff related to the dog.
ie
SIRE :
DAM :
HANDLER :
BREEDER :

once i achieve those 4 fields im done with owners!!

#1195615

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Martin,

Ok happy we are making progress here.

So now since
SIRE :
DAM :
HANDLER :
BREEDER :

Information is related to your dog, then you will need to create a view for each of this and add it to the view that displays the dog on the owners page.

Once you have done this you will be able to get the relationship information of the Sire, Dam, Handler and Breeder since this information is all related to the dog.

Please let me know if this is clear.

Thanks,
Shane

#1195621

i have all that info all ready on the single dog page here
hidden link

#1195635

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Martin,

So we are well on the way to resolve this.

What you need to do now is to create copies of these views that you are using on this page to display the information and add it to the view that is displaying the Dogs on the Owner's page.

Now in the copies you will need to change the filter option on the view "The post where this View is shown" to "The current post in the loop".

This should resolve this issue.

Thanks,
Shane

#1195688

thank you Shane hopefully i can catch you before you finish,!!
the dog is displayed on the owner page from this view
hidden link
i added [wpv-view name="view to show sire on a single owner page" wpvrelatedto="[wpv-post-id item='@dog-sire.parent']"]
i get no items found.
i made the duplicate to show the sire hidden link

what am i missing?

thank you ever so much i think i'm a heart beet from succesfully accomplishing this!

#1195956

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2019-02-05 at 6.15.18 AM.png

Hi Martin,

My shift had closed before I got your last reply.

I realised later on when I did some more investigation on this that the "The current post in the loop" setting wouldn't work for you in this case.

What was actually needed was the "The post with ID set by the shortcode attribute" Now it works fine because we are already printing out the dog information this is correct.

See my screenshot.

Now i've set it to get the id of the dog in the relationship by a shortcode attribute "wpvrelatedto".

Then I inserted this view into your "view to show dog ids for an owner" view. Finally passing the ID of the dog being displayed by this view into the view to display the sire.
[wpv-view name="view-to-show-sire-on-a-single-owner-page" wpvrelatedto='[wpv-post-id item="@owner-dog.child"]']

A quick look on the frontend and it should now be printing the correct sire for this test dog.

Please let me know if this helps.
Thanks,
Shane