Skip Navigation

[Closed] I need to display the custom taxonomy in the sidebar, using the same hierarchy

This support ticket is created 7 years, 4 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.

This topic contains 6 replies, has 2 voices.

Last updated by Mladen Andrejic 7 years, 3 months ago.

Assigned support staff: Mladen Andrejic.

Author
Posts
#306251
esp_category.png

I am trying to: display the post hierarchy in the sidebar

I visited this URL:

I expected to see: hidden link

Instead, I got:

#306333

Hello,

Can you please elaborate a little bit more what your issue is, and what are you trying to achieve?

I am not sure if I understood you right, you want to have the same hierarchy as in screenshot for your custom taxonomy?

If so, maybe you can find this documentation file useful https://toolset.com/documentation/user-guides/wordpress-archive-cell/

Thanks.

#309999

Hi,
Can I do this without using layout?

I want to display a list of taxonomies using the correct hierarchy.

Thanks.

hidden link

#310001
Image 7.jpg

Here's a screenshot

#310130
view-test.png

Hello,

So basically the idea is to create two views. One that will display list of parent categories, and one that will display the list of children.

1. Create View for Parent categories :

- Name : MC1
- Display All results
- Content Selection : Taxonomy (Machines Categories)
- Add parent filter : Parent is the taxonomy selected by the parent view
- Loop Output should be :

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<ul>
		<wpv-loop>
			<li>
				[wpv-taxonomy-link]
			</li>
                [wpv-view name="MC2"]
		</wpv-loop>
	</ul>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		[wpml-string context="wpv-views"]<strong>No items found</strong>[/wpml-string]
	[/wpv-no-items-found]
[wpv-layout-end]

2. Now create the second View that will display children categories :

- Name : MC2
- Display All results
- Content Selection : Taxonomy (Machines Categories)
- Add parent filter : Parent is the taxonomy selected by the parent view
- And the simplest loop

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<ul>
		<wpv-loop>
			<li>
				[wpv-taxonomy-link]
			</li>
		</wpv-loop>
	</ul>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		[wpml-string context="wpv-views"]<strong>No items found</strong>[/wpml-string]
	[/wpv-no-items-found]
[wpv-layout-end]

And now use [wpv-view name="MC1"] to display the first View that will show something like what I created (you can see the screenshot)

Thanks.

#310250

Hi,
Thanks, this is looking good now. However if the parent has got more than 1 level of child category let say MC3 it's ok to use this method. But if it has around 10 sub levels how do we proceed? Thanks.

e.g.
Parent
--Child 1
----Sub Child 1
------Sub Sub Child 1
--------Subx3 Child 1

#312095

Hello,

Sorry for the late response. Then the idea is to loop actually the first View we created, this should be easier as well.

Instead of using 2 Views we can use just one and loop the same again.

Output would be like this (in case we're still using MC1 name) :

[wpv-layout-start]
    [wpv-items-found]
    <!-- wpv-loop-start -->
    <ul>
        <wpv-loop>
            <li>
                [wpv-taxonomy-link]
            </li>
                [wpv-view name="MC1"]
        </wpv-loop>
    </ul>
    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
        [wpml-string context="wpv-views"]<strong>No items found</strong>[/wpml-string]
    [/wpv-no-items-found]
[wpv-layout-end]

The topic ‘[Closed] I need to display the custom taxonomy in the sidebar, using the same hierarchy’ is closed to new replies.