I've asked already about nested categories here, but I've just upgraded to Craft 3 and things seem to have changed a little.

I have three top-level category groups:

- Home
- About
- Funding

Each of these has multiple categories, and some of these categories are nested up to three levels deep.

My problem: the nested category URIs don't include the category group (which I appreciate doesn't have its own slug). Instead I get stuff like this:


... when what I want is:


If I manually add funding/ or about/ as part of those categories' URI formats (eg. funding/{parent.uri}/{slug}) then it appends funding/ at each level, eg: funding/funding/funding/cat-B/subcat-2/subcat-6.

I've managed to achieve what I want for entries, by setting their URI format like so:


... which gives me stuff like:


I only really need this feature to work because I envision users browsing the categories and potentially clicking the URI/links and being taken to the wrong place.

In my earlier post I created a top-level category group called "Navigation" which contained all my categories – this achieved the correct URIs. This feels messy/hacky though and means my users have to see a redundant "Navigation" group when editing categories.

It's likely I'm misunderstanding some aspect of Craft here – can anyone help me achieve what I'm trying to do here?

  • I can't tell... is this specific to Craft 3 or do you have the same issue on Craft 2?
    – Brad Bell
    Sep 14, 2017 at 15:43

3 Answers 3


I'm not sure if this is a Craft 3 only issue. The following should work on Craft 2:

Top-level Category: something/{slug}

Nested Category: {parent.uri}/{slug}

  • Thanks – I ended up making a top-level "Navigation" category group and then added all my categories under that. I then used a section with this Entry URI format: {category.last().uri}/{parent.uri}/{slug}. Sep 15, 2017 at 13:02

You would just enter { parent? parent.slug : '' }/{ slug } in the "Category URI Format" Field in the Craft3 CP and it will recognize nested categories


You can use Twig logic in you Category URL Format like this:

{parent ? parent.uri : group.handle }/{slug}

This will prepend the category group's handle (main, about, funding, etc.) if it's a top-level category (no parent). Otherwise it prepends the parent category's full URI.

Given you have a Category Group called "About" with the handle "about," and that group has nested categories like this:

|-- cat-1
|   |-- cat-1-1
|   |-- cat-1-2
|       |-- cat-1-2-1
|-- cat-2

You'll get URIs like this:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.