...will contain all child pages of folder /details plus all pages with category 'MyCategory'. Since the both items are in folder /details I get all pages in /details
How do I create a collection that only contains pages from folder /details AND also have category 'MyCategory';
I see two alternatives depending on your situation:
If there are also pages with category 'MyCategory' outside folder /details, you will need to create two separate collections and apply method intersect.
See Multiple Collections to create two collections in a page. One for all pages in the /details folder and the other for all pages with category "MyCategory".
Then in Twig, get both collections from the page and use an "intersect" (see Collection Object Methods):
Collection::intersect($collection2) Merge two collections, keeping items that occur in both collections (like an "AND" condition)
If there are no categories outside folder /details, then the following will give only the pages with the proper category:
The frontmatter snippet you're showing contains incorrect Yaml. If you truly use that in your page's frontmatter, an error should be thrown.
The correct frontmatter should be:
YAML
pages:items:'@page.children':/details
You might want to update your posts accordingly.
It is a bad habit to override existing Twig variables. This may lead to hard to trace issues. pages is such a variable which is provided by Grav. See Theme Variables
The previous layout (two columns of mini-pages) has changed to a one-column layout.
You are implying that a new module is changing the layout of another module. I don't see how a module could interfere with the layout of another module, unless the HTML generated by the Twig template is incorrect.
The second collection is not displayed at all.
How do you know it is 'not displayed' versus 'empty'? Did you dump the collection to the debugger?
What should I do in order to have multiple “page collection modules” on my modular page?
I don't know... You might want to check your Twig and check if your collection isn't empty.