Hi,
I created a blog with different categories and subcategories. Some categories only have pages and other have subcategories then pages. I call a category a folder.
For example, I have 1_travel/cityguide/2019042_article/article.php
(category and subcategory) and 2_lifestyle/20190305_article/article.php
(just a category).
There’re also two different templates for the articles: first as seen before (article) and another like this: 1_travel/roadtrip/20181031_article/article-video.php
(article-video).
I want to display a list of the articles on the root of my panel and to be able to create a new article or article-video that I can set on any (sub)category.
I tried many options like
parent: kirby.index.templates("article", "article-video")
or
query: site.index.templates("article", "article-video")
or
query: site.index.filterBy("template", "in", ["article", "article-video"])
etc…
I also created a collection
// collections/articles.php
return function ($site) {
return $site->children()->index()->filterBy('template', 'in', ['article', 'article-video']);
};
and then
query: site.collection("articles")
but nothing works, either the list is empty or an error appears.
I tried the plugin pagesdisplay but here all pages from the site folder are displayed, not the ones I want.
I don’t understand exactly how collections work and I think I didn’t use it properly. Maybe you can help me in that direction? Or maybe the answer is completely different, I’m a bit lost.
Thanks