Hosting with 20% off when you buy through the link

Categories and tags

Group content with categories and tags. Each term gets its own listing page automatically, can sit under a parent, carry fields of its own and follow an order you drag.

With three posts nobody needs categories. With thirty, they are the difference between a blog people browse and a pile. In Velk, categories and tags are taxonomies: named sets of labels — the terms — that you attach to content. A blog has categories and tags, a recipe site has courses and ingredients, a clinic has specialties.

There are no built-in categories: you ask for the taxonomies the site needs, with the names and the address you want, and the AI declares them in site.json. One taxonomy can serve more than one content type.

Ask the AI

Create a “Category” taxonomy for the blog posts, plural “Categories”, at the address /category. Categories can have subcategories, and each one has a short description shown at the top of its page. Also create “Tags” for the posts, without levels, at /tag. No other content type uses them for now.

Give the singular, the plural and the address, as for content types: without them the AI has to guess.

Another example

For the bakery's products, create a “Line” taxonomy (Breads, Cakes, Savory) that I can put in order by dragging. Lines don't need pages of their own: they only group the products on the menu page.

Dragging is manual_order; no pages of their own is has_page: false. You don't need those names — describing the behavior is enough.

Each term has a page, automatically

Here a taxonomy differs from a content type. A content type has no automatic listing: the blog's list is a page you create. A taxonomy has one: every term answers at its own address — /category/recipes lists the published posts marked Recipes, newest first, laid out by the taxonomy's template (the theme file that draws the page). Nobody creates those pages: they exist as soon as the term does, and they go into the sitemap, the list of addresses search engines read.

The address /category alone is not a page. A page listing every category is a regular page whose template lists them.

What the AI runs
$ ./bin/velk schema:validate ✓ site.json is valid. # since v3.9.0 it also lists templates the theme is missing $ ./bin/velk serve ✓ Velk serving on http://localhost:8080
Then create two or three terms in the admin, mark a post and open /category/your-term on the site.

Options worth knowing

Ask forWhat you get
Subcategories (hierarchical)A term can have a parent: Recipes › Desserts. The address nests (/category/recipes/desserts) and the term's screen gets a Parent term field.
No pages of its own (has_page: false)Terms exist and are ticked in the editor, but their addresses answer 404 (not found) and stay out of the sitemap. For labels that only filter or decorate, like a dish's allergens.
Fields on the termsA description, an image, a color: each term gets its own fields, edited on its screen and read by the template of its page.
A different layout per termThe taxonomy can offer alternative templates, and the editor picks one per term — for the one category that deserves a page with a look of its own.
Drag to order (manual_order, v3.7.5)Terms come out in alphabetical order; with this the client drags the order on the taxonomy's list, and the site follows it with no change to the theme.

In the admin

  1. Find the list

    A taxonomy appears in the sidebar under the content type that uses it. One that no type uses sits in a Taxonomies group of its own.

  2. Create the terms

    Each term has a name, an address (slug) filled in from the name and, if declared, a parent and its fields. Terms are created here; the post editor shows the ones that exist.

  3. Mark the content

    In the post editor each taxonomy is a set of checkboxes: tick every term that applies. With no terms yet, it links to creating the first one.

  4. Reorder, if allowed

    With manual_order on, the list has drag handles. The first time it opens it keeps the current order, and you drag from there.

Questions

Do category pages get SEO fields?

No. The built-in title, description and share image belong to pages and content items, not to terms. If category pages need a description of their own, ask for a description field on the terms and for the theme to use it on the category page.

Does a post in a subcategory show on the parent's page?

By default a term's page lists the posts marked with that term. Tick both the parent and the subcategory when a post should appear on both pages.

Can I type a new tag in the post editor?

No: the editor offers the terms that exist, as checkboxes. New tags are created on the taxonomy's screen, then ticked in the post.

And on a multilingual site?

A term is the same in every language: its name, address and fields get language tabs, and posts keep their terms in every language.