Skip Navigation

[Resolved] Needing to display a view on a page not directly related to the content

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
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)

This topic contains 6 replies, has 2 voices.

Last updated by Christian Cox 5 years, 12 months ago.

Assisted by: Christian Cox.

Author
Posts
#1171317

Tell us what you are trying to do? I have Departments and Parent Departments, and Staff Members. This one staff member (Michael Harryman) is a supervisor, so he only has a parent department and does not have a department. I made a view of Parent Department IDs, and a view ("UL departments associated with a parent department") and related them using the wpvrelatedto operator. This ID is for your convenience echoed in the staff department content template. You will notice it only appears on the other staff members, and not in Michael Harryman.

Is there any documentation that you are following?

I got help in a previous support ticket. The staff members displayed on the Staff member pages are displayed in similar arrangements. My profile page has Michael Harryman listed as my parent department supervisor (based on the parent department M2M relationship.)
Is there a similar example that we can see?

What is the link to your site? hidden link

#1171318

Please request that I add an admin login account for you.

#1172053

Hello, can you please share login credentials in the private reply fields here?

#1173498

This ID is for your convenience echoed in the staff department content template.
1. What is the staff department content template? There is no post type called "Staff Department." There is no Content Template called "Staff Department". So I don't know what you're talking about.

2. I don't see an ID echoed in any Staff Member single post, like Chester Lee or John Vieth. Can you take a screenshot so I can see this ID you mentioned?

3. What is your question or problem? Nothing in your message explains what is wrong or how you would like to fix it.

#1173614

I meant to say it is the content template assigned to staff member (single) which in this case is Staff Members (Profile Prototyping) (ID:20). Michael, a staff member custom post type does not display my view and I'm wondering how best to display departments related to parent departments on his page. He is not related to any departments, and yet I need to display departments related to the parent department. I outputted an ID view (but even that does not output). [wpv-view name="parent-department-listing-by-id"]

--Sam

#1173625
#1173627

I outputted an ID view (but even that does not output).
Okay this Content Template is not applied to any posts, so you will not see it anywhere on the front-end of the site:
hidden link

I can see that you have the Toolset Layouts plugin active. In general, it's recommended to use a Template Layout to display single posts if you have Toolset Layouts active. Template Layouts override Content Templates. So if you want to use Toolset Layouts, you can edit this Layout:
hidden link
Add the View shortcode in this Layout, then assign the Layout to this Staff Member post ( Michael Harryman ).

If you would prefer to use Content Templates instead of Template Layouts, you can deactivate the Toolset Layouts plugin. Then assign the Content Template to this Staff Member post (or all Staff Member posts).

I'm wondering how best to display departments related to parent departments on his page. He is not related to any departments, and yet I need to display departments related to the parent department.
Create a View of Parent Departments, and add a Post Relationship Query Filter. The Parent Department should be related to the current post or page. Then create another View of (child) Departments. Add a Post Relationship Query Filter, where the parent Parent Department is set by the current post in the loop. Insert the View of child Departments inside the Loop of the View of parent Departments. Even though Michael H is not associated with any child departments, all child Department(s) for his Parent Department(s) will be displayed, because the Post Relationship filter only considers the parent / child Department relationship.