Nested taxonomy links? #5790
Replies: 3 comments 4 replies
-
Unless I'm misunderstanding, it sounds like you could use nested taxonomy tag loops. <ul>
{{ taxonomy from="one" }}
<li>
{{ title }}
<ul>
{{ taxonomy from="two" }}
<li>
{{ title }}
<ul>
{{ taxonomy from="three" }}
<li>{{ title }}</li>
{{ /taxonomy }}
</ul>
</li>
{{ /taxonomy }}
</ul>
</li>
{{ /taxonomy }}
</ul> |
Beta Was this translation helpful? Give feedback.
-
This looks like a bit too complex data structure design. Your "Products" sound like product categories. Maybe you're better off creating a collection for each? I'm trying to understand why you have 4 taxonomy fields (Groups 1 to 4) and not one that can select terms for each four. If you explain it better maybe we can help you create a custom tag that does what you're trying to do. |
Beta Was this translation helpful? Give feedback.
-
Managed to get this working...
Writing the steps out here for future me.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've got a collection called
products
, I've attached fourtaxonomies
to the collection.I'd like to create a sidebar menu, listing terms from each taxonomy, but I can't figure out how to display the taxonomies so they are nested?
This outputs a long list alphabetically, of all the terms from each of the four taxonomies
This gives me a flat list, ordered alphabetically...
What I want to do is nest them, to create a taxonomy menu like this
I think I understand why the
taxonomy
works like this. It’s simply spitting out all the terms from each taxonomy - it has no way to know if they are related...Perhaps the
collection
tag is a better route? I’m using the four taxonomies on a collection called products. Here each entry is associated with more than one taxonomy. Could this be used to generate a nested menu?I'm thinking I need to loop through
collection:products
, instead of displaying entries - is there a way to list nested taxonomies based on their relationship with an entry?I'm considering building a navigation, but that'll mean manually adding the name and url of each term, not ideal.
Is there a way to achieve this using antlers?
Beta Was this translation helpful? Give feedback.
All reactions