@heihachi88:
Won’t your example make a huge performance hit?
I wouldn't know. I'm really quite new to Grav. I suppose, once Easter is over and the forum becomes more vivid, somebody with more experience might double check this.
That being said: I got that approach from reading the Twig templates of the "Antimatter" theme where looping over pages.children.visible is used in the navigation partial. Also, my expectation would be that a) performance issues would come up only with really, really huge sites. (It's just looping through an PHP array and checking a value.) and that b) caching takes care of that anyways.
I don't quite understand, why you need to construct a collection in Twig. My (possibly wrong) understanding is that collections are just a way to define a set of pages in a page's markdown file. In my (again: possibly wrong) understanding, they're not something you'd define in a Twig file.
However, in that vein, the documentation mentions taxonomy collections: https://learn.getgrav.org/content/collections#taxonomy-collections
So if it's okay for you to define your main_article pages by adding a tag instead of a field in the frontmatter, you might just use something like (untested):
content:
items:
'@taxonomy.tag': main_article