Skip Navigation

[Resolved] Having trouble with great-grandchild view lists

This support ticket is created 5 years, 7 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 9 replies, has 3 voices.

Last updated by joe-enteleos 5 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#1116574
Data Structure v2.png
View Query Section.jpg
View Loop Section.jpg
Explorer Page with View 2.jpg

Hello,

I've set up the following with a fairly complicated post types / relationships architecture (see diagram). If you could take a look to help me see what's gone wrong, I would appreciate it.

I am attempting to display all the States connected to an Explorer. To do so, I've set up the following content templates. (POV is Point of View, a naming convention that helps me make sense of all this.)

***
POV Self: Post Title Link (pov-self-post-title-link)

[wpv-post-link]

POV State Group: State Title Link (pov-state-group-state-title-link)

[wpv-post-body view_template="pov-self-post-title-link" item="@state-in-group.child"]

POV Cluster (From): State Title Link (pov-cluster-from-state-title-link)

[wpv-post-body view_template="pov-state-group-state-title-link" item="@cluster-shift-from.child"]

POV Explorer: State Title Link (pov-explorer-state-title-link)

[wpv-post-body view_template="pov-cluster-from-state-title-link" item="@explorer-cluster.child"]

***

Then, I set up a View, POV Explorer: State Title Links. I've attached screenshots of my settings.

Finally, to test, I inserted the View directly into the content of an Explorer page (Rebecca), to display as an unordered list. What displays is a series of blank list items, showing the correct number of bullets (18) as the number of States for the Explorer. But no titles/links display at all.

To test further, I added the Content Template POV Explorer: State Title Link directly. The Content Template displayed a single State link, which I suppose is expected.

I've attached a screenshot of the page, which you can see directly here: hidden link

I imagine the unordered list is full of empty lines because of something missing in the View setup. Could you help me identify what went wrong?

#1117006

Hello,

I assume we are talking about the same problem of your previous post:
https://toolset.com/forums/topic/needing-to-show-post-title-links-from-grandparent-and-beyond/#post-1116082

I can get your website credentials here:
https://toolset.com/forums/topic/needing-to-show-post-title-links-from-grandparent-and-beyond/#post-1115148

Same as above one, I need your permission to test and debug it in your website, please backup your website first, then update here. thanks

#1117175

Hello Luo,

Yes, this is the same, and yes your login information is still active, and yes, please do proceed.

Joe

#1118096

I assume you are using below post structures:

- Child post type "State"
-- parent post type "State Groups", relationship "States in Group"
--- Grandparent post type "Cluster", there are two relationships between post type "Cluster" and "State Groups":
"Cluster Shift From" and "Cluster Shift to"
---- Great-grandparent post type "Explorers", relationship "Explorer Clusters"

If it is, it needs 3 level nested views, for example, you can try these:
1) 1st level post view: Grandparent Cluster posts of current Explorers post
hidden link

query Cluster posts, filter by:
Select posts in a Explorer Clusters relationship that are related to the Post where this View is shown.

In the view's loop display below two 2nd level views

2) 2nd level post view: parent State Groups posts of current Cluster post
a) Cluster Shift From:
hidden link
query "State Groups" posts, filter by:
Select posts in a Cluster Shift From relationship that are a related to the current post in the loop.

In the view's loop display below 3rd level view

b) Cluster Shift to:
hidden link
query "State Groups" posts, filter by:
Select posts in a Cluster Shift To relationship that are a related to the current post in the loop.

In the view's loop display below 3rd level view

3) 3rd level post view: State posts of current State Groups post
hidden link
query "State" posts, filter by:
Select posts in a States in Group relationship that are a related to the current post in the loop.

4) Create a content template: single explore post CT
hidden link

Display the 1st level view, and assign it to a explore post:
hidden link

Test it in front-end:
hidden link

For your reference. more help:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items
Displaying many related items

#1118856

Thank you for this Luo!

Just returned from a long trip away. Will dive into this tomorrow and let you know how it all comes together.

#1118867

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Luo is on vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.

Yes - please feel free to get in touch with me if you require further assistance.

#1120411

Still working on it. Expect to get some resolution tomorrow or Friday and will let you know how it goes and if I have further questions for this issue. Thanks!

#1120422

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok great. No issues.

#1121698
Flowchart State List on Explorer.jpeg
StateList-on-Cluster.jpg
StateList-on-Explorer.jpg

OK, so I've had a good look at it, and there is still a problem I've been unable to solve. I'm hoping you can help.

To summarize, I am attempting to list great-grandchild States on an Explorer post. In between we have child Clusters and grandchild State Groups. The challenge is that there are two different relationships between Clusters and State Groups, and we want to list the states belonging to the two different State Groups linked by these different relationships. (See Data Structure v2.png in the first post for reference.)

To do this, Luo set up a series of nested Views as follows:


VIEW: grandparent-cluster-posts-of-current-explorers-post
Display Clusters. Select from Explorer Clusters relationship related to current post.
LOOP: 
[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<ul class="wpv-loop js-wpv-loop">
		<wpv-loop>
			<li>[wpv-post-body view_template="Loop item in Grandparent Cluster posts of current Explorers post"]</li>
		</wpv-loop>
	</ul>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

LOOP TEMPLATE: "Loop item in Grandparent Cluster posts of current Explorers post"
[wpv-post-link] shift-from: [wpv-view name="parent-state-groups-posts-of-current-cluster-post-cluster-shift-from"]
[wpv-post-link] shift-to: [wpv-view name="parent-state-groups-posts-of-current-cluster-post-cluster-shift-to"]

***

VIEW: parent-state-groups-posts-of-current-cluster-post-cluster-shift-from
Display State Groups. Select posts in a Cluster Shift From relationship related to current post.
LOOP:
[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<ul class="wpv-loop js-wpv-loop">
		<wpv-loop>
			<li>
				[wpv-post-link] [wpv-view name="state-posts-of-current-state-groups-post"]
			</li>
		</wpv-loop>
	</ul>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

***

VIEW: parent-state-groups-posts-of-current-cluster-post-cluster-shift-to
Display State Groups. Select posts in a Cluster Shift To relationship related to current post.
LOOP: 
[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<ul class="wpv-loop js-wpv-loop">
		<wpv-loop>
			<li>
				[wpv-post-link] [wpv-view name="state-posts-of-current-state-groups-post"]
			</li>
		</wpv-loop>
	</ul>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

***

VIEW: state-posts-of-current-state-groups-post
Display States. Select posts in a States in Group relationship related to current post.
LOOP:
[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<ul class="wpv-loop js-wpv-loop">
		<wpv-loop>
			<li>
				[wpv-post-link]
			</li>
		</wpv-loop>
	</ul>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

(If needed, please refer to the visual flowchart Flowchart State List on Explorer.jpeg attached.)

The problem is that the State Group and related States display for only one of the Cluster-State Group relationships, (cluster-shift-from), while the second relationship (cluster-shift-to) displays the "No items found" message. (See the StateList-on-Explorer.jpg attachment.)

When I test the key shortcodes for displaying from both relationships, by placing them in a Cluster post as follows, they display as expected:

shift-from: [wpv-view name="parent-state-groups-posts-of-current-cluster-post-cluster-shift-from"]
shift-to:[wpv-view name="parent-state-groups-posts-of-current-cluster-post-cluster-shift-to"]

(See the StateList-on-Cluster-jpg attachment.)

I have been unable to figure out why the State Group and States list does not display from the cluster-shift-to relationship. Hoping you can help!

Minesh, if Luo is still on vacation and you will be working this ticket, and you would like to view the admin area of this installation, please feel free to use the login credentials here: https://toolset.com/forums/topic/needing-to-show-post-title-links-from-grandparent-and-beyond/#post-1115148 .

Thank you!

#1121721

Found the problem!

A simple matter: The View "parent State Groups posts of current Cluster post - Cluster Shift To" had a filter to select State Groups related to "The post where this View is shown" rather than "The current post in the loop." Changing that filter setting fixed the problem, and now I am able to display all States related to the Explorer.

Thank you both! Figuring this stuff out is giving me a quick education in Toolset.

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