# Related Collections

**URL:** https://forum.getkirby.com/t/related-collections/27746
**Category:** Questions
**Tags:** v3
**Created:** [February 2, 2023, 2:29pm UTC](https://forum.getkirby.com/t/related-collections/27746 "2023-02-02T14:29:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/martin/32/12860_2.png) [@Martin](https://forum.getkirby.com/u/Martin)
#### Post date: [February 2, 2023, 2:29pm UTC](https://forum.getkirby.com/t/related-collections/27746/1 "2023-02-02T14:29:50Z")

</div>

Hello there,

I’m pretty new to Kirby and ran into my first problem I can’t figure out a solution.

I’ll have two collections. One manages Companies, the other one the Sectors.

So I’ve managed a select field in the company blueprint, that queries the sectors. Every Company can be part of only one sector, so this works fine.

But I want to show in the sector (backend blueprint) all companies that are attached to a sector. And I don’t really know how I’m going to query this. In the sector panel there should be a related pages section that displays all companies that were attached to this sector by the selection of the select field in the company blueprint.

I’ll hope that’s kinda understandable.

I know that I should query the attached UIDs. But I don’t know where and how to start.

---

<div class="post-metadata">

### Author: ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)
#### Post date: [February 2, 2023, 3:13pm UTC](https://forum.getkirby.com/t/related-collections/27746/2 "2023-02-02T15:13:19Z")

</div>

> In the sector panel there should be a related pages section that displays all companies that were attached to this sector by the selection of the select field in the company blueprint.

You want this as a read-only section?  
To use as a reference?

---

<div class="post-metadata">

### Author: ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/martin/32/12860_2.png) [@Martin](https://forum.getkirby.com/u/Martin)
#### Post date: [February 2, 2023, 3:17pm UTC](https://forum.getkirby.com/t/related-collections/27746/3 "2023-02-02T15:17:13Z")

</div>

Just as a set of related pages. The edit option would be ok but not necessary.  
In the Frontend the companies of a sector should also be avaiable to be listed on the sector detail page.

---

<div class="post-metadata">

### Author: ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)
#### Post date: [February 2, 2023, 4:17pm UTC](https://forum.getkirby.com/t/related-collections/27746/4 "2023-02-02T16:17:13Z")

</div>

> In the Frontend the companies of a sector should also be avaiable to be listed on the sector detail page.

I’m confused now. Do you want the companies to be displayed on the frontend or in the backend?  
You’re currently assigning a sector to a company. If what you want is to then, in the frontend page for the sector, display a list of companies in that sector, then it’s a matter of filtering your companies using the current page as the reference value.

There’s a nice guide on filtering: [Filtering compendium | Kirby CMS](https://getkirby.com/docs/cookbook/content/filtering)

But this is just at the frontend level. The blueprint is not involved at all.

---

<div class="post-metadata">

### Author: ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/martin/32/12860_2.png) [@Martin](https://forum.getkirby.com/u/Martin)
#### Post date: [February 2, 2023, 4:36pm UTC](https://forum.getkirby.com/t/related-collections/27746/5 "2023-02-02T16:36:41Z")

</div>

Well, both. I want to show the sector on the company page in the Frontend and the Companies assigned to the sector on the sector page in the Frontend.

But my first concern is the automatic assignment of the companies to the sector panel page for all companies that are assigned to a sector on the company panel.

---

<div class="post-metadata">

### Author: ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)
#### Post date: [February 2, 2023, 5:50pm UTC](https://forum.getkirby.com/t/related-collections/27746/6 "2023-02-02T17:50:55Z")

</div>

> [@Martin](#):
>
> But I want to show in the sector (backend blueprint) all companies that are attached to a sector.

You need a plugin for this, the pagesdisplay section that allows you to use a query: [https://getkirby.com/plugins/rasteiner/pagesdisplay](https://getkirby.com/plugins/rasteiner/pagesdisplay)

In your query, you can then filter all companies that have the current sector assigned.

---

<div class="post-metadata">

### Author: ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/martin/32/12860_2.png) [@Martin](https://forum.getkirby.com/u/Martin)
#### Post date: [February 2, 2023, 7:01pm UTC](https://forum.getkirby.com/t/related-collections/27746/7 "2023-02-02T19:01:12Z")

</div>

Thank You, I’ll try that!
