First of all: Thank you, that you are always taking the time to help newbies like me to understand Grav a little bit better! I highly appreciate it!
@pamtbaau:
Ok, so the title of the post doesn’t really reflect the issue. Or does it? If not, please update the title.
Unfortunately I do not know how to edit the title, but the long form would be "Adding a collection module that lists pages with a certain taxonomy category from a specified subfolder like blog items are listed on the blog page". I hope, that this clarifies my goal. Thank you for pointing this out.
@pamtbaau:
the selection of pages does not reflect the specified category
You haven’t mentioned what the selection does reflect, so, based on the images you’re showing, I’m guessing it repeatedly shows the content of the modular page and not the pages in the collection.
I have created four pages in my details folder, two of them having a category, two of them are without any taxonomy. The first thing I expected was, that only two and not four pages were caught in the collection.
Secondly I expected that the child page were rendered, but instead the content of the module (which is supposed to function as introductary text) is rendered in all four calls. Your explanation clarified this behaviour, thank you! I changed the variable from child to page and this fixed it.
The first phonomenon remains though: The taxonomy category is ignored and all four sub pages are rendered.
I still wonder, why the YAML is reformatted and strangely indented, once I hit save. The original was
items:
- '@page.children': /details
- '@taxonomy.category': [MyCategory]
and this was turned into
items:
-
'@page.children': /details
-
'@taxonomy.category':
- MyCategory
Might this be the problem, why the proper selection of the collection fails?
And is there a way to hinder Grav to reformat the frontmatter or does this happen for a good reason that I simply do not understand? At least it looks ugly ... ;)
@pamtbaau:
Solutions:
- Add
never_cache_twig: true (or cache_enable: false ) to the frontmatter of the ‘pages’ module.
Awesome, it works. I wish I knew so much about the inner mechanisms as you do. Thank you again so much!
May I ask two additional questions that just came to my mind?
I did not understand the whole bricklayer thing. Is there an easy way to control the amount of bricks (I guess those are the summary cards that are displayed) in a row? I would like to have, for example, max 4 bricks per row.
And is there a way to have this parameter editable in the web frontend page editor for the average user like features are managed in the feature module?