Skip Navigation

[Resolved] insert a View link in loop to show post details

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

Problem:

Essentially the issue here is that the user wanted to add the link to the post in his view to a text.

Solution:

To do this you will just need to specify the shortcode like the example below.

<a href='[wpv-post-url]'>Click Me for Details</a>
This support ticket is created 6 years 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)

This topic contains 17 replies, has 2 voices.

Last updated by patricioC 6 years ago.

Assisted by: Shane.

Author
Posts
#627176

Hi!

I have two custom types, "tasks" and "comments". Comments is the son of tasks.

I have the following case:
I have a view where I show all the tasks in a loop and for each item I want to have a link that directs me to another view to show the details of that task, that is, the task fields. I do not know in this case how to relate a view to another view or what is the most effective way to do it. I have tried with layouts but something I am doing wrong. Could you help me with this?

Once you have the new view with the details of a task, within that same view I want to show all your child's "comment" posts. https://toolset.com/documentation/user-guides/querying-and-displaying-child-posts/

Another option that had occurred to me was to have a link to another view where I directly show the post child (comments) and bring some fields of the post parent, as a header.

#627380

Shane
Supporter

Languages: English (English )

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

Hi Patricio,

Thank you for contacting our support forum.

I'm not sure I understand the issue exactly.

Based on the link you sent, is it that you want to display your child posts "Comments" in the same view that is displaying the Tasks?

Or is it that you want to display the comments on the tasks details page.

Please let me know.

Thanks,
Shane

#627399
tasks.jpg

Hi Shane.
I added the link to comment on the final goal I want to reach.

What I want to solve now specifically, is that in the view where I show all the tasks in a loop, I can have a link that directs me to another view to show the details of that task, that is, the fields of the task. I do not know in this case how to relate a view to another view or what is the most effective way to do it. I've tried with designs but something I'm doing wrong.

Seeing the capture with the loop of all the tasks, for example, I want the last icon to have a link to another view where I can see the details of task 1.

#627486

Shane
Supporter

Languages: English (English )

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

Hi Patricio,

Correct me if i'm wrong but now you just need to link to the actual post itself correct?

Essentially a project details page.

Please let me know.
Thanks,
Shane

#627492

Shane.

The previous capture has the tasks loop, and the icon marked in red (for illustrative purposes) should take me to another view where it shows the details of that task (task 1). That's what I'm trying to do now.
I hope I have been a little clearer. Sorry for my English.

Thanks!

#627494

Shane
Supporter

Languages: English (English )

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

Hi Patricio,

SO the details of the tasks are comments?

What is meant by details.

Thanks,
Shane

#627502

The task details are all task fields (title, state, delivery date, etc.).
I want to achieve that, and after in this view I will show all child post of task, that is, "comments".

#627503

Shane
Supporter

Languages: English (English )

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

Hi Patricio,

So this is what is needed then.


<a href='[wpv-post-url]'>Click Me for Details</a>

This will take you to the details page of the post.

#627514

I tried it and when you enter it shows the blank page with a link "Edit this", which directs you to edit the post from the back-end.

What may be happening? I have verified the permissions and it seems that everything is fine.

Remember I want after to show all child posts (comments) also on that same page.

I proposed to create a new view, because on that page, in addition to showing all child post (comments), I would also like to add a link to a form to be able to add a new comment.

#627520

Shane
Supporter

Languages: English (English )

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

Hi Patricio,

Would you mind providing me with admin access to the website and a link to the view so that I can take a look a this for you ?

The private fields will be enabled for your next response.

Thanks,
Shane

#627795

Shane
Supporter

Languages: English (English )

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

Hi Patricio,

The issue with the blank page seems to be coming from your theme itself as when I switch to a default theme the page shows up fine.

Are the pages blank as a result of using Toolset? Does any content show up when toolset is disabled?

Please let me know.
Thanks,
Shane

#627815

Hi Shane.

I just checked what you say and you're right, it does not work because of a problem with the template.
Irrespective of correcting the template, what I want to do can not be achieved in this way with "wpv-post-url", because afterwards I can not insert a view to show all childs posts of task "comments". Correct?

Have you seen the second option I've tried, through a view in a layout?

Thanks.

#627881

Shane
Supporter

Languages: English (English )

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

Hi Patricio,

What is needed now is to create the template so that the items display.

Once you create the template then you can create a view for the comments and add a parent filter to it, select the option "Parent is the page where view is displayed"

Then just add this view to the template for the tareas CPT.

Thanks,
Shane

#627892

Shane.

I understand what you tell me. What I do not understand how to do, is how to link a task of the loop with the new view where I will show the fields of tasks and the child post "comments". When I click on the link in the loop, I want it to take me to another page where I can see the new view.

The rest you tell me, I already know how to do it.

Thanks!

#628368

Shane
Supporter

Languages: English (English )

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

Hi Patricio,

I'm not sure I understood fully your previous comment. What is it that should be display first A list of Questions ?

Clicking on a question takes you to the questions page where you can see the question in full and the comments below.

Correct?

Please let me know if this is what you're referring to.
Thanks,
Shane

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