<p>You can do an entry query with the type parameter:</p>
<p><a href="https://craftcms.com/docs/3.x/entries.html#type" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/entries.html#type</a></p>
<pre><code>{% set entries = craft.entries().section('channelName').type('typeName').all() %}
</code></pre>
<p>Or expressed without chaining and possibly better readability without having new lines for each parameter.</p>
<pre><code>{% set entries = craft.entries({
    section: 'channelName',
    type: 'typeName'
}).all() %}
</code></pre>

CC BY-SA 4.0
2022-08-04T11:25:48.043Z
Let suppose i have a case named "Case 1" in which i can select "service 1" and "service 2", which are services entries. I can get these services on "case 1" details page but how i  can get "case 1" when i go to "service 1" or "service 2" page ? Please reply i need it as soon as possible. 

I can guess it will be done using relatedTo but im not able to create such element query in twig file.
Vinod Patidar
CC BY-SA 4.0
2022-07-08T08:48:27.147Z
2022-07-08T08:48:27.147Z
James White
<p>I have two channel types section namely &quot;Services&quot; and &quot;Cases&quot;. I have added caseServices as entry field in cases. I can get services of a case in twig as entry.caseServices. But how can i get cases where a particular service used to show on service page ?</p>
<p><a href="https://i.sstatic.net/Q2J0Q.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Q2J0Q.png" alt="Image preview" /></a></p>

<craft3><entries><sections>
Get entries in an entry type in twig template
# Get entries in an entry type in twig template

(Asked by: username_0 on 2022-07-08)

I have two channel types section namely "Services" and "Cases". I have added caseServices as entry field in cases. I can get services of a case in twig as entry.caseServices. But how can i get cases where a particular service used to show on service page ?

[![Image preview](https://i.sstatic.net/Q2J0Q.png)](https://i.sstatic.net/Q2J0Q.png)

**Tags:** craft3, entries, sections


---

## 1 answers

### Answer by username_1 on 2022-07-08. Score: 2

You can do an entry query with the type parameter:
https://craftcms.com/docs/3.x/entries.html#type
{% set entries = craft.entries().section('channelName').type('typeName').all() %}

Or expressed without chaining and possibly better readability without having new lines for each parameter.
{% set entries = craft.entries({
    section: 'channelName',
    type: 'typeName'
}).all() %}

> **Comments:**
> **username_0**: Let suppose i have a case named "Case 1" in which i can select "service 1" and "service 2", which are services entries. I can get these services on "case 1" details page but how i  can get "case 1" when i go to "service 1" or "service 2" page ? Please reply i need it as soon as possible.   I can guess it will be done using relatedTo but im not able to create such element query in twig file.  

---

