Perlkonig / grav-skeleton-knowledge-base

Skeleton package of the Knowledge Base theme for Grav CMS
https://www.perlkonig.com/knowledge-base
MIT License
22 stars 14 forks source link

Ordering categories. #10

Closed hifall closed 6 years ago

hifall commented 6 years ago

How does one order categories based on some criteria? Is it possible to manually assign some integer to each category for this purpose?

For example, I have 2 categories of articles: Fiction and Non Fiction, in alphabetical order. Each category contains several articles. Now I want Non Fiction to appear before Fiction. How do I go about this?

Thanks!

Perlkonig commented 6 years ago

The point of a list of categories is to make it easy for the user to find the category they want. Alphabetical is the only logical way to do that. I'm afraid I don't plan on incorporating custom sorting for the category list out of the box.

However, you can inherit the theme and alter the sidebar code. The file in question is templates/partials/sidebar.html.twig. Let me know if you have further questions.