How I can create many categories of articles in website?

Hi there. This functionality is built in to Grav using taxonomies and page collections.

Two taxonomies are already set by default in the admin: ‘category’ and ‘tag’

To assign an article to category/categories and/or tag(s) you add them to the page frontmatter such as:

taxonomy:
    category:
        - category1
    tag:
        - 'multi-word tag'
        - tag2
        - tag3

For a page that lists all articles from category1 for example, you would create a new page with the following in the frontmatter:

content:
    items:
        '@taxonomy.category': category1
    limit: 8
    order:
        by: date
        dir: desc
    pagination: true

Functional example can be found here where I created a page that displays only blog posts from the visual category.

If you have more questions please don’t hesitate to ask! :slight_smile:

1 Like