Hello everybody,
I'm looking for advices to achieve some kind of pages. After many tries I'm not sure what is the best option to do it.
Here's a page I want to build:
- Some standard content (text, titles, images...)
- A list of hyperlinks to other pages
- Some more standard content
- Another list of hyperlinks to other pages
- Some more standard content
I want these lists of hyperlink to be dynamics, meaning that each page in a list must belong to another user/pages directory and/or fit a taxonomy. For exemple, all pages in the "news" directory, or all pages with the "fruit" tag, or all pages in the "members" directory with the "administrator" or the "worker" tag.
I'm facing two problems here:
Problem 1:
I want the standard content to be easily editable, and the differents parts of the page to be easily movable. The best option for that seems to have all the standard content in a single markdown page, with specials "placeholders" that mark the position of the 2 hyperlinks lists.
I've found 2 options for this:
- Enable twig processing in the frontheader and use a {% include 'partials/list1.html.twig' %} to position a list.
- Use the inject plugin.
Not sure if the inject plugin is required, the first option seems ok to me. Can you confirm this is a good way to go ?
Or am I trying, with option 1, to use grav in a way it is not intended for ? Perhaps I must give up to offer this editing facilities and create a modular page that will break down the standard content in many markdown files, with the drawback that the template must be edited to rearrange the page order ?
Problem 2:
Assuming the option 1 is the right way to go, I've created a partial template for each hyperlink list. But I can't find how to get a list of pages that belong to another user/pages directory and that fit at the same time a taxonomy with multiples conditions, like 'category'='event' AND ('tag'='dinner' OR 'tag'='birthday"). I write here about the problem 2 because perhaps my difficulty here is related to a bad design choice in problem 1 ?
Thank you for your answers, can't find the solution myself after hours reading the doc and searching the forum.