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 tutorial. routes.yaml file:
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:
However it looks like this isn’t possible, according to this 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.
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.
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?
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.
@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
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?