(SOLVED) Sorting my website with crossed post PARAMS (categories)

*** Hello Hugo communicty :slightly_smiling:

I am a UX/UI Designer.
After a lot of reading about Static websites, I decided to develop my portfolio with Hugo :slightly_smiling:
It’s for me the time to understand more of back-end tricks…

I’ve understood basics stuffs and started coding, but I really don’t understand the Syntax’s Logic, so I need you !

I’ve added .Params.categories to my posts.
categories = [“da”,“video”,“illu”]
And now I would like to be able to sort my works by categories on the List Page.

For example : Summer Tee Collection is going into 4 categories, whereas another project will be in only 2 of them.

Thank you for your help, I really would like to make part of this community, so I’ll give you news when my template will be getting up (fully responsive and with nice CSS3 animations)

1 Like

Hi @keauval, welcome. There are some examples already in this community, about filtering. Just search on “category filtering” or “taxonomy filtering”.

Hello :slightly_smiling:
I’ve rode the complete documentation and search on the forum… but I’m really blocked and found no issue :frowning:

Does someone could help me a litttttle bit more pliz ? I’m really near of finishing my responsive portfolio’s template, I’ll enjoy share you after that !


I think i’m a good way !

I finally found this somewhere, which helps me a lot :

`{{ range $name, $taxonomy := .Site.Taxonomies.categories }}

  • {{ $name }} ({{ $taxonomy | len }})
  • {{ end }} ` Now I'm looking to how make page/layout for each category page… Not sure to be able to find an automatic solution :confused:

    Help, I’m becoming crazy.

    I think the solution is Javascript to change the post list… something like :

    When X_TAXONOMY selected

    {{ range .Site.Taxonomies.categories.X }}

  • {{ .Page.Title }}
  • {{ end }}

    …as you see I have only the Idea … You think it’s possible ?

    Many many many thank’s

    Javascript runs in the browser after the site is rendered by hugo, which is when those template codes would be used. Javascript would not have any impact on your template code.

    Are you sure of that ?

    Here is what I want.

    I’m asking a friend who’s developper, perhaps he’ll have the solution.

    What I don’t understand is that Hugo is generating /categories/X/ folder…

    But I didn’t find the way possible to make a generic template for the /categories/XorYorWcategory/list.html file
    within :

    {{ range .Site.Taxonomies.categories.XorYorWcategory }}

    I’m sure that I failed understanding something in the taxonomy display process… Could you help me ?