Skip Navigation

[Resolved] Displaying child view on non-parent page

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

Problem: I have a View that is set up to display related child posts. It works on the parent post page, but I would like to display the View on a different page. When I move the View, it doesn't work.

Solution: Duplicate the View and modify the Query Filter to respond to a URL parameter or a shortcode attribute instead of the post where the View is shown. Pass the correct parent post ID into the View using a URL param or a shortcode attribute.

Relevant Documentation:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/

This support ticket is created 5 years, 11 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by laurencea 5 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1197864

was directed to create new thread from existing thread:
https://toolset.com/forums/topic/edit-post-form-on-separate-page/#post-1197866

Hi, could you guide me on rendering this view on it's own page?
hidden link

Right now, i just have everything on one page, hidden by user role.
hidden link

If you switch to my user account with a Parter role (laurenceanthony1) and visit the above page, you'll see the Supporters tab.
I'd like for this to be on its own url too. ie. /view-supporters.

#1198240
Screen Shot 2019-02-10 at 1.11.54 PM.png

Hi, if you want to place the View on a separate post or page, then you need a way to define the parent Partner. As it is configured now, the View's post relationship filter is set to respond to the post where this View is shown. Instead, you need a filter that responds to a URL parameter. I would duplicate this View first. Then in the duplicate, choose the appropriate Query Filter option for URL parameter (screenshot) and place this new View on the view-supporters page. Then you must create links to the View Supporters page with the Partner ID encoded in the URL parameter, like this:

<em><u>hidden link</u></em>

When the page loads, the View filter will only show those Supporters related to Partner 1688 - Chris. If you want to create a link from Chris's post, you would add something like this in the Partner template:

<a href="<em><u>hidden link</u></em>;">See Supporters for Partner [wpv-post-title]</a>

Let me know if you have questions about this.

#1198302

Thanks Christian. Think I'm missing something.
I've updated the partner search here with My Supporter links
hidden link

Then duplicated the view and added it to the My Supporters page here
hidden link

The sortable table headers are displaying but the loop isn't. Supporters do exist for that post ID.
I'm not sure what I'm missing here.

But another thing, I realized I'd like to have the My Supporters page viewable only to the author assigned to the Partner post.
Your help is appreciated!
-larry

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/restrict-access-to-specific-user-based-on-url-parameter/

#1198803
Screen Shot 2019-02-11 at 11.51.51 AM.png

The sortable table headers are displaying but the loop isn't.
It looks like the loop template was commented out for some reason (see screenshot). I removed the comment tags and I can see results now. Check and let me know if the results are what you expect.

<!-- this is a comment. nothing between these tags will be shown on the screen -->

But another thing, I realized I'd like to have the My Supporters page viewable only to the author assigned to the Partner post.
Our support policy is one issue per ticket, to help keep the forum organized. I'm splitting this into a separate ticket where we can discuss in more detail. Thanks for understanding.

#1198809

My issue is resolved now. Thank you! Perhaps lack of sleep is making me blind lol