# Slug hierarchy?

**URL:** <https://www.ruby-forum.com/t/slug-hierarchy/87854>\
**Category:** Radiant CMS\
**Created:** [March 6, 2007, 12:27pm UTC](https://www.ruby-forum.com/t/slug-hierarchy/87854 "2007-03-06T12:27:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![modhelius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@modhelius](https://www.ruby-forum.com/u/modhelius)\
**Post date:** [March 6, 2007, 12:27pm UTC](https://www.ruby-forum.com/t/slug-hierarchy/87854/1 "2007-03-06T12:27:30Z")

</div>

Hello,  
Possibly a stupid question, but here we go:

Can you organize slugs hierarchically? One alpha-slug to rule them  
all? Militant slugs with religious leaders?

No I mean something like this:

Home (/)

- about (/about)
- animals (/animals)
  - about (/animals/about)

- plants (/plants)
  - plants (/plants/about)

When I try to add a child to “animals” and give it the slug “about” I  
get a 404 when i go to /animals/about

Do slugs have to be unique?

How can I fix this?

Regards,  
Martin O.  
[http://smpl.se](http://smpl.se)

---

<div class="post-metadata">

**Author:** ![modhelius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@modhelius](https://www.ruby-forum.com/u/modhelius)\
**Post date:** [March 6, 2007, 12:45pm UTC](https://www.ruby-forum.com/t/slug-hierarchy/87854/2 "2007-03-06T12:45:30Z")

</div>

On 3/6/07, Martin O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Home (/)
> 
> - about (/about)
> - animals (/animals)
> - about (/animals/about)
> 
> - plants (/plants)
> - plants (/plants/about)

This is what Radiant is all about.

When I try to add a child to “animals” and give it the slug “about” I

> get a 404 when i go to /animals/about

Do the tests pass for you? Does the “animals” page have the slug set as  
“animals”? You shouldn’t be getting a 404

Do slugs have to be unique?

Only if they are siblings. Your setup is perfectly fine.

---

<div class="post-metadata">

**Author:** ![modhelius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@modhelius](https://www.ruby-forum.com/u/modhelius)\
**Post date:** [March 6, 2007, 12:45pm UTC](https://www.ruby-forum.com/t/slug-hierarchy/87854/3 "2007-03-06T12:45:30Z")

</div>

Hello,  
I figured it out and kind of solved it. The problem was that the “/  
animals” page was an Archive, which meant that the slug became  
“2007/3/6/about” - which is fine. I can hide the post, and link to it  
using its “date-slug”.

This is the result:

[http://smpl.se/bath/](http://smpl.se/bath/)

Radiant is soo cool. Regards /Martin

---

<div class="post-metadata">

**Author:** ![modhelius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@modhelius](https://www.ruby-forum.com/u/modhelius)\
**Post date:** [March 6, 2007, 12:48pm UTC](https://www.ruby-forum.com/t/slug-hierarchy/87854/4 "2007-03-06T12:48:31Z")

</div>

On 3/6/07, Martin O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I figured it out and kind of solved it. The problem was that the “/  
> animals” page was an Archive, which meant that the slug became  
> “2007/3/6/about” - which is fine.

Why is it an Archive? “animals/about” was much nicer!

Archive usually makes sense when there are _a lot_ of posts (like on a  
blog).

---

<div class="post-metadata">

**Author:** ![modhelius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@modhelius](https://www.ruby-forum.com/u/modhelius)\
**Post date:** [March 6, 2007, 1:01pm UTC](https://www.ruby-forum.com/t/slug-hierarchy/87854/5 "2007-03-06T13:01:31Z")

</div>

Yeah,  
The pages “animals” and “plants” are project blogs, so they’ll have  
lots of posts.  
/Martin
