Hello,
I am new to Grav and would like to update my homepage using this CMS. I’ve been experimenting with the Future2021 theme, but I realize I need to learn more about how Grav works first.
I’m particularly struggling with creating my Articles page, which needs to display multiple types of articles. Here’s what I’m trying to achieve:
-
When users click on “Articles” in the navigation, they should see a list of existing article categories (for example: Texas, STM, RTOS, etc.)
-
When they select a category, they should see a list of articles within that category
-
Each article should have a “Read more” link to view the full content
I’m facing several issues and I’m not sure if I’m approaching this correctly. I don’t know which classes to use or how to properly structure this organization. I can never seem to get this hierarchy working properly.
Here is my website so you can get an idea of what I’m trying to accomplish: Article List
I would be very grateful if someone could help me with this Articles section.
Thank you!
@HomeInit, Sounds like you want a blog page…
You can have a look at a demo skeleton of a blog and even download the skeleton itself to play with it and discover its setup.
Off course its layout is a bit different, but that’s just some Twig and css.
Also study the docs on Taxonomy, which is at the heart of blog like pages.
Hello pamtbaau,
I think I need to use the blog page, but first I need to decide how to organize each category. I’m considering using modular, but I’m not sure how to implement them properly.
Here is the structure I want to create:
I have a main menu item called “Articles.” When users click on Articles, a new page opens displaying a menu of categories:
-
RTOS
-
Texas Instruments
-
STM
On this same page, I want to display a blog listing filtered by these categories (doc cards). When a user selects a category (such as “Texas”), they should see a list of all published articles in that category. Then, when they click on a specific article, a new page opens showing the full article content. It would be preferably to have a comments section.
I’ve already implemented something similar on my current website site, but I want to make it more professional using Grav.
@HomeInit, A modular page is a total different beast and does not provide the functionality you are after. Please read the docs on Modular Pages | Grav Documentation.
Please note, Taxonomy does not provide a tree-structure out-of-the-box. Play around with the skeleton I mentioned above to get some understanding. And read Taxonomy | Grav Documentation and Page Collections | Grav Documentation
I think i have to use modular cause each article must have a comment section.
I don’t know how Grav manage users comments, i think it would be a plugin but no idea if i need to list comment users after the article.
No, you don’t… You add the Twig template of a Comments plugin into the Twig template of a blog-item (your blog article).
1 Like