NTH: Tailor collection component > Filter by content_group

I found something, that can be usable for filtering content by content_group. For example, when creating something like Content objects (eg “Blog” post), there can be multiple types of post (eg, gallery, video, audio… )

In my case: I created a content item with groups like (article, job_offer, event, video) …
and, may be a nice feature, if collection has content groups, allow in component to filter by content group…

and another (in my case strange thing)…
in twig we have “entry_type” and database field is named “content_group”. both of these can be used, but im not able to find any documentation belongs to it

Tips & tricks:
For now, if you wish to “filter” from tailor collection, you can use:

{% for item in tailorCollection.whereContentGroup('your_group').latest().get() %}
{% endfor %}

This is covered here in the documentation:

{% set bluePosts = posts.where('content_group', 'your_group').get() %}

It is the same as whereContentGroup which is a dynamic syntax alternative.

tried to find where(‘content_group’ is mentoined, but is not at all… and, without knowing anything about structure of tailor tables (eg. hashed table names etc etc.) there are no list of columns of tailor, then, im not sure what can be used in query… and, as i wrote, there are two different naming for that, as entry_type and content_group … right? then, this can be (as is) really missunderstood

Content group is mentioned on the Tailor Models page

Attribute Description
content_group The content group name, if used.