Is there any way to make a blog post sticky, that is, always show at the top of the collection list?
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
@andro, Did a quick search on the github repo of Grav...
Question Sticky blog posts #156 shows how this can be implemented.
In short:
- Add extra 'featured' category type
- Assign 'featured' to blog page(s)
- In template that lists blog items,
- First list blog items from collection based on 'featured'
- Then list other blog items based from default collection of blog.
Hi @andro, you can also see an example of this type of thing in my Quark Open Publishing theme (thought I am sure the Twig can be improved!):
https://github.com/hibbitts-design/grav-theme-quark-open-publishing/blob/master/templates/blog.html.twig#L70-L80
Thank you all. Obviously an excellent solution in concept. But I am using Gantry 5 with the Hydrogen theme, so pardon this newbie next question, where can I find pointers on how to make a new template for Gantry Hydrogen? It's not immediately apparent, and web searches turn up virtually nothing about how to make a template in Gantry.
@andro, I'm sorry, but I have no experience, nor knowledge about Gantry...
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 53 | 9 hours ago | ||
| 2 | 59 | 12 hours ago | ||
| 1 | 30 | 13 hours ago | ||
| 2 | 65 | 5 days ago | ||
| 2 | 56 | 5 days ago |