<p>Yes. It is possible, you need to specify the craft category and set the group parameter on it and fetch the categories with <code>.all()</code>.</p>

<pre><code>{% set categories = myCategoryQuery.all() %}
</code></pre>

CC BY-SA 4.0
2019-04-17T01:22:20.603Z
2019-04-22T22:38:56.330Z
2019-04-22T22:38:56.330Z
Priti Rathod
<p>I have two different sections that share the same category group that I want to display both on browser at the same time only if the category is the same. Doing that in Craft CMS is possible?</p>

<p>Thank you.</p>

CC BY-SA 4.0
2019-04-16T22:32:26.367Z
Can you please add more details to your question? Are you trying to create a related entries view that searches by category in two sections? Is this on a single entry view or an overview entry listing page?
Simon Kuran
<templating><categories>
Two entries same category
# Two entries same category

(Asked by: username_0 on 2019-04-16)

I have two different sections that share the same category group that I want to display both on browser at the same time only if the category is the same. Doing that in Craft CMS is possible?

Thank you.

**Tags:** templating, categories
> **Comments:**
> **username_1**: Can you please add more details to your question? Are you trying to create a related entries view that searches by category in two sections? Is this on a single entry view or an overview entry listing page?  

---

## 1 answers

### Answer by username_2 on 2019-04-17. Score: 1 | Accepted answer

Yes. It is possible, you need to specify the craft category and set the group parameter on it and fetch the categories with .all().
{% set categories = myCategoryQuery.all() %}


---

