Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Ordering blog page by Title

Started by Levy 2 years ago · 4 replies · 333 views
2 years ago

Hello, i'm building my first Grav site and I'm facing an issue that I don't see from the documentation how to solve it. I have a blog page (type blog) with page content (type item). Pages has a title which contains a number (part 1, part 2, etc...). When I specify in the blog page '@self.children' with 'Ascending', the blog root page displays the blog items in the right order (Part 1, 2, 3, etc...) but the Prev/Next buttons in the blog children pages point in the other order (eg: From Page 2, Prev points to 3 and Next to 1). When I specify 'descending', its the contrary (Prev/next are correct, eg from page 2, Next point to 3 and Prev to 1, but the blog page display descending, top is part 4, then part 3, etc...). I can't see an option to order blog root page and children page next/prev in the same order for both.

last edited 01/25/24 by Levy
2 years ago

Check this topic:
/forum/support/page-prevsibling-nextsibling-inverted-t6809

I believe this is the case you're referring to. I agree it's counter intuitive and there's a workaround available for theme creators. But if you're using one of the default themes, the order is in reverse 🤷‍♂️

2 years ago

Many thanks for this quick and very useful reply @Karmalakas. Effectively the post corresponds exactly to my case. If I do understand, it's the blog "concept" which inverts the Prev /Next buttons actions of the blog pages. I never remarked that... very strange indeed. But for my own case to read the next pages in the right order I will then place a link instead of the standard buttons to read the next chapter. Anyway, thank you very much. I could spend hours before I understand that it was a concept issue and not a question of understanding the page configuration system.

2 years ago

You could extend the theme you're using and update that single template, which has the pagination, by reversing the logic

2 years ago

OK, i will try this. But I would rather prefer to avoid any developments. Even if i know how to write a program and also the web technologies, I will try for my first implementations to use the full Grav standard by using the configuration tools. And I can already see that it's very powerfull. 🙂

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 94 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 184 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 146 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 60 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 254 1 year ago