# Content Collections Help

**URL:** <https://forum.ghost.org/t/content-collections-help/6262>\
**Category:** Routing\
**Created:** [March 15, 2019, 8:38am UTC](https://forum.ghost.org/t/content-collections-help/6262 "2019-03-15T08:38:38Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![omisnomis](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@omisnomis](https://forum.ghost.org/u/omisnomis)\
**Post date:** [March 15, 2019, 8:38am UTC](https://forum.ghost.org/t/content-collections-help/6262/1 "2019-03-15T08:38:38Z")

</div>

I have just got up and running with Ghost, for a new website idea. I wanted to order my posts chronologically, which I did by following [this](https://docs.ghost.org/tutorials/chronological-posts/) tutorial. `routes.yaml` file:

```
routes:

collections:
  /:
    permalink: /{slug}/
    template: index
    order: asc
  
taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/

```

What I would actually like to do now, is to replicate the `/` route entirely and put it under `/new` which would show the same posts but in reverse chronological order. Something like this:

```
routes:

collections:
  /:
    permalink: /{slug}/
    template: index
    order: asc
  
  /new/:
    permalink: /new/{slug}/
    template: index
    order: desc

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/

```

However it looks like this isn’t possible, according to [this](https://docs.ghost.org/tutorials/creating-content-collections/) articles because of the following:

> The order that collections are listed in `routes.yaml` is important. **Posts will only exist in one collection** , which is always the first filter it matches with. Be mindful of this when creating three or more collections for your site.

Is there a way of doing this?

---

<div class="post-metadata">

**Author:** ![Kate](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kate/32/35_2.png) [@Kate](https://forum.ghost.org/u/Kate)\
**Post date:** [March 15, 2019, 8:46am UTC](https://forum.ghost.org/t/content-collections-help/6262/2 "2019-03-15T08:46:38Z")

</div>

Hey! The thing you are looking for might be “channels”.

Take a look at [Tutorials](https://docs.ghost.org/tutorials/building-a-content-hub/)

---

<div class="post-metadata">

**Author:** ![omisnomis](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@omisnomis](https://forum.ghost.org/u/omisnomis)\
**Post date:** [March 15, 2019, 9:10am UTC](https://forum.ghost.org/t/content-collections-help/6262/3 "2019-03-15T09:10:58Z")

</div>

Hey @Kate! Thanks for replying so quickly. So that sort of works, but I imagine I’m doing something wrong.

I changed my `routes.yaml` file to the following:

```
routes:

/new/:
  controller: channel
  template: index
  order: desc

collections:
  /:
    permalink: /{slug}/
    template: index
    order: asc

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/

```

Which does indeed let me navigate to my `/new` endpoint - and the posts are displayed in reverse chronological order, but it’s displaying a 404 error instead of the `index` theme I was expecting.

`/new` page:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/be2fe63d51f8d3abb9f620f67f95f6f87f4e8c44.png)

---

<div class="post-metadata">

**Author:** ![omisnomis](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@omisnomis](https://forum.ghost.org/u/omisnomis)\
**Post date:** [March 15, 2019, 9:11am UTC](https://forum.ghost.org/t/content-collections-help/6262/4 "2019-03-15T09:11:57Z")

</div>

I wasn’t allowed to add multiple images (due to being a new user) - this was the theme I was expecting:

`/` page:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/e/ec9805e2c90bfa72a42c6c2a38b83694da633f48.jpeg)

---

<div class="post-metadata">

**Author:** ![omisnomis](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@omisnomis](https://forum.ghost.org/u/omisnomis)\
**Post date:** [March 15, 2019, 11:37am UTC](https://forum.ghost.org/t/content-collections-help/6262/5 "2019-03-15T11:37:52Z")

</div>

OK - so the 404 seems to have been happening because I didn’t have a page set-up with the url `/new/` so I set one up but then the posts don’t actually show up. Is it not possible to replicate my homepage, into the new route, just with a different ordering of stories?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/3/39bd0147e552fec543e34514f707524faa1c6b58.jpeg)

---

<div class="post-metadata">

**Author:** ![Kate](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kate/32/35_2.png) [@Kate](https://forum.ghost.org/u/Kate)\
**Post date:** [March 15, 2019, 2:53pm UTC](https://forum.ghost.org/t/content-collections-help/6262/6 "2019-03-15T14:53:37Z")

</div>

Can you please your current state of routes.yaml?

---

<div class="post-metadata">

**Author:** ![omisnomis](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@omisnomis](https://forum.ghost.org/u/omisnomis)\
**Post date:** [March 15, 2019, 3:11pm UTC](https://forum.ghost.org/t/content-collections-help/6262/7 "2019-03-15T15:11:29Z")

</div>

Hi @Kate

I actually got it sort of working (below), but it looks like you’ve got some CSS that is only in effect for the home page; and I’m not sure exactly what is different so I can’t get it to the look the same as the home page.

I don’t suppose you know what classes or styles I need to add to get the overlay effect, like the homepage has (second screenshot)? The homepage has a `margin-top` of `-70px` and `padding-top` of `0` but then that renders the nav element unreadable.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/6/67aec873125d458d849d26161c55907a90f40c57.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/bc5a3c94afecba40d4d22b697143c14a00e1f0fe.jpeg)

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [March 15, 2019, 5:59pm UTC](https://forum.ghost.org/t/content-collections-help/6262/8 "2019-03-15T17:59:43Z")

</div>

@omisnomis are you looking for the `home-template` class on the `<body>` tag? You’ll need to add that manually as it only gets added to the `/` route automatically

---

<div class="post-metadata">

**Author:** ![omisnomis](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@omisnomis](https://forum.ghost.org/u/omisnomis)\
**Post date:** [March 16, 2019, 12:30pm UTC](https://forum.ghost.org/t/content-collections-help/6262/9 "2019-03-16T12:30:29Z")

</div>

Hi @Kevin - Yes, it looks like I am! How can I get that class to be added to the `<body>` tag on my `/new` route as well? I don’t think I have access to the Body tag when I’m creating a page… Do I?

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [March 18, 2019, 11:30am UTC](https://forum.ghost.org/t/content-collections-help/6262/10 "2019-03-18T11:30:39Z")

</div>

There are a couple of options:

1. Have a completely separate layout file for this route based off `default.hbs`

2. Modify your `default.hbs` layout so that other templates can specify other body classes, eg

---

<div class="post-metadata">

**Author:** ![omisnomis](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@omisnomis](https://forum.ghost.org/u/omisnomis)\
**Post date:** [March 19, 2019, 8:35am UTC](https://forum.ghost.org/t/content-collections-help/6262/11 "2019-03-19T08:35:14Z")

</div>

@Kevin - That was exactly what I was looking for, thank you. I guess I’m going to have to learn Handlebars if I want to really get into Ghost 🙂

Just in case anybody comes across this, looking to do what I was trying to achieve, the handlebars tag needs a hashtag at the beginning:

`{{#contentFor "custom_body_class"}}home-template{{/contentFor}}`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [April 2, 2019, 8:35am UTC](https://forum.ghost.org/t/content-collections-help/6262/12 "2019-04-02T08:35:15Z")

</div>

Closed on April 2, 2019, 8:35am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
