Hi!
I’m currently migrating a bigger E-Commerce Page from CQ5 to hugo and I’m having a problem with a hierarchical taxonomy. The original one has to levels like main category and sub category. Then follows the content.
To maintain the current order, I thought OrderedTaxonomies might be a good idea, but I don’t understand the example. Questions are:
Where to put the definition of the taxonomy. Still in the fron matter of the content (but that wouldn’t make that much sense due to ordering, right?) ? Would this be something like
mainCategory: []struct {
Common
...
}
And what are WeightedPages? I could not find any example for that. Can anyone point me in the right direction or to an existing project on github using this?
Order the way the keys for a taxonomy are displayed
Order the way taxonomyed content appears
Taxonomies aren’t hierarchical by design, but there have been discussions about workarounds in this forum (search?) – but that will mean some double book keeping.
Thanks for the reply. But as far as I understand, you can order taxonomies itself (not the content) either alphabetically or by popularity. If you want a different order, you should use http://gohugo.io/taxonomies/methods/
And the example code
[]struct {
Name string
WeightedPages WeightedPages
}
does not help me to dive deeper into this. Sorry, if I missed something obvious here…
Ah, OK – I see the documentation you point to is very “source code” like … And could be improved. Other will chime in, I’m a little busy now, but will try to explain later.
thanks for the hint, but as far as I understand, the weight - also the taxonomy_weight - controls the order of the content in the taxonomy view, not the taxonomy term itself. Thats why I need the ordered taxonomy. I also tried different approaches with menus. But I cannot “range over” the content associated with a certain parent menu.
I’m a bit lost at the moment…