Skip Navigation

[Resolved] Display child taxonomies

This support ticket is created 7 years, 1 month 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 15 replies, has 2 voices.

Last updated by Christian Cox 7 years ago.

Assisted by: Christian Cox.

Author
Posts
#577043

Tell us what you are trying to do?

I amb building a website with divi theme. I want to list products, but before to list that products i want to list of taxonomes (tipos de productos). That taxonomies have child taxonomies. When I click in parent taxonomy i want to list in a grid child taxonomies. I have 2 views. One for parent and other for child

Parent view: show taxonomies - tipos de producto
Query-> Taxonomy terms parent none

Child taxonomies view: show taxnomies - tipos de producto
Filter - Taxonomies term parent view

Page of parent taxonomies- > hidden link
Page of child taxonomies -> hidden link

When I am in page of parent taxonomies, when I click in a parent taxonomy, it link to custom type products, not to page of child taxonomy. How can I solve this?

The page of child taxonomies is listing parent and child taxonomies. I want to list only child taxonomies filtered by parent taxonomy. How can I solve this?

#577115

When I am in page of parent taxonomies, when I click in a parent taxonomy, it link to custom type products, not to page of child taxonomy. How can I solve this?
It looks like your View of taxonomy terms is set up to link to the term archive, perhaps using the wpv-taxonomy-link shortcode. This will create a link to the standard WordPress Archive for this term, for example:
hidden link

If you want to link somewhere else, you need to create your own link manually in the Loop Output editor. How you create this link is up to you, but it could be something like this example:

<a href="path/to/page/[wpv-taxonomy-slug]">[wpv-taxonomy-title]</a>

In this case, you must manually create custom Pages for each possible term slug, and the page slug must match the term slug identically.

Or, you can create one custom Page that accepts a taxonomy term ID as a URL parameter:

<a href="path/to/page?term=[wpv-taxonomy-id]">[wpv-taxonomy-title]</a>

On that page, you can place a View that is filtered by term, provided by a URL parameter.

The page of child taxonomies is listing parent and child taxonomies. I want to list only child taxonomies filtered by parent taxonomy. How can I solve this?
You have 3 options for a taxonomy parent filter:
1. Parent is set by the parent Taxonomy View
In this case, you must place this View inside another Taxonomy View. The "outside" View must be filtered by term ID. That term ID can be passed in as a URL parameter or a shortcode attribute.

2. Parent is set by the current Taxonomy Archive page
This won't work, because you are using custom Views instead of the standard WordPress Archive pages created by WordPress.

3. Parent is a specific, predefined term
This could work, but you would have to create a separate View for each parent term. This isn't really practical for a lot of results.

#577835

Hi Christian. Thanks for your help.

I followed your instructions.

But i don't know how create one custom Page that accepts a taxonomy term ID as a URL parameter that works.

I have this url: hidden link Folowing your instructions links to hidden link

But this gets a 404 error. In adition this page have configured the view the same way that you suggested me -> Taxonomy term ID is set by the URL parameter "tipo"

I don't know what doesn't work. Can you help me?

Thanks in advanced!

#577876

Okay I think there was a typo in my instructions, sorry. I have corrected that above. Try this format, with a ? instead of &:
hidden link

#580135

Hi Christian. I'll try it this weekend. Thanks!

#580323

Okay great, I will stand by for an update.

#582662

Hi Crhristia. I haven't got time this week. I0ll test this weekend. Please... wait to close this topic until I test your instructions.

Thanks!

#582667
Captura de pantalla 2017-10-27 a las 11.50.56.png

Hi again Christian. Just tested your instructions. The sub cats page list content now, not error 404, but the content is the parent category, not the child categories of parent category

I f i click hermeticidad, it would list láminas (child category of hermeticidad) but list hermeticidad again.

The view of child categories is cocnfigured like as the screenshot that I add here. I dn't know what is the problem.

Thanks again for your help.

#583086
Screen Shot 2017-10-29 at 12.02.22 PM.png

Okay great, what you have is a View of parent terms. Now, you need to create another View of the same Tipos de Producto taxonomy. In this second View, you will set up a term parent filter, where the parent term is the set by the parent taxonomy View. See the attached screenshot for an example of a similar term parent filter.

Next, in the Loop Output editor of the first View you created, add new View using the Fields and Views button. It will insert the View shortcode, something like this:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<wpv-loop>
		[wpv-view name='your-second-view-slug']
	</wpv-loop>
	<!-- 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]

This is called nesting Views, or Views inside of Views. Now instead of showing hermeticidads, the first View will show the child láminas.

More info about nested Views here:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

#583091

Hi again Christian.

Thanks for your help.

I don't want nested views. I want to display a second page with child taxonomies of the parent taxonomy.

Page 1 is for parent taxonomies. If i click in any of parent taxonomies, i go to page 2 that display child taxonomies of the clicked parent taxonomy.

The nested views is to display parent and child taonomies at the same time, but I don't want this.

The problem is that page hidden link shows parent taxonoies. If I click hermeticidad... goes to hidden link and that page don't show child taxonomies of hermeticidad. It shows hermeticidad again. If you click in aislamiento in hidden link... it goes to hidden link and show parent taxonomy aislamiento and i want that it shows child taxonomies of aislamiento.

DO you understand me?

#583340

Hi, yes I understand you but I think my instructions must have been unclear. Let me try to clarify.

The nested views is to display parent and child taonomies at the same time, but I don't want this.
Nested Views can be used to display parent and child taxonomies at the same time, but in this case you will not display anything about the parent taxonomy. You will show a View of child terms and nothing about the parent term. So the parent taxonomy View is only used to establish context, filter the parent term, and to include the child term View.

<wpv-loop>
  [wpv-view name='your-second-view-slug']
</wpv-loop>

In the code above, we include the child View in the parent View. Notice that we are not including any shortcodes that display information about the parent term. If you wanted to display information about the parent term, you would do something like this:

<wpv-loop>
  Parent term: [wpv-taxonomy-title]
  Child terms: [wpv-view name='your-second-view-slug']
</wpv-loop>

Since we are not including any parent term information in the first example above, the nested Views will only show information about the child terms.

Does this make more sense now? If you'd like, I can help set up an example on a test site so you can see how it should work.

#584040

Hi again Christian

I followed your instructions but now categories page lists all child taxonomies of all parent taxonomies in the parent taxonomies page.

I think that u understand me, but i pus the scheme again

Parent taxonomies page - > Child taxonomies page pf clicked parent taxonomy - > Products of child taxnomy clicked

First level works perfect with the original view, but with new view it list ll child taxonmies of all parent taxonomies.
Second level is not working yet
Third level is not built yet

#584582

I'm sorry, we aren't understanding each other. If it's okay with you, I will be glad to log in and set this up for you so you can see what's supposed to happen. Then we can discuss in more detail if you'd like. If that's okay with you, please provide login credentials here for me in the private reply fields.

#586467

Here's what I've got so far.

At /pagina-de-categorias-de-muestra
This page includes the View of top level terms: [wpv-view name="categorias-de-productos"]
This View output includes links to each term like:
/subcategorias-productos/?tipo=2
/subcategorias-productos/?tipo=3

The subcategorias-productos page includes a View of terms: [wpv-view name="subcats1"]
This View is filtered to show the product categories that are the same as the "tipo" URL parameter. That means that it will show one result - the top-level term you clicked on the previous page. Inside the Loop Output of this View, we do not show any information about the current term, because we want to show information about its child terms instead. So we have inserted a View of terms where the parent term is set by the parent View: [wpv-view name="catsisubcats"]

In the catsisubcats View, I have included a link to each term archive using wpv-taxonomy-link.

Take a look and let me know if I can help clarify this any further.

#586867

Hi again Christian.

It works perfect now. If i want to list subcats in bootstrap grid what must i edit. Now it show the taxonomies in list If I use the loop assistant it modify the code.

I don't know how can i get the same layout of parent taxonomies.

Thanks in advanced.