<p>My approach:</p>
<ul>
<li>Create one channel for events with different entry types (solo-events, conference-events)</li>
<li>Create one channel for conferences</li>
<li>Re-use the date fields in both channels</li>
<li>That way you can fetch and order events by the re-used date fields from both channels limiting to the entry types of solo-events and conferences with one query. That makes listings, filtering and paging easy.</li>
<li>Conference-events can be eager-loaded with the query as well</li>
<li>The entry type for conference-events has a mandatory entry field for the conference</li>
<li>In the control panel you can show the related conference by adding the field as a column in the overview</li>
<li>Speakers is another channel or structure being linked from within the conference-events</li>
</ul>
<p>Why I would not use:</p>
<ul>
<li>Matrix: can be easily queried but can not eager load the entry it belongs to</li>
<li>Category: feels wrong to always add categories for new conferences</li>
<li>Structures for events: Structure are not 100% user friendly when adding new entries, as they always need to be sorted manually (though there are some improvements in 3.7 coming up)</li>
</ul>

CC BY-SA 4.0
2021-04-09T15:16:47.117Z
Thank you very much! I am testing your approach at the moment and I have a question about it: Is it possible to filter the entries in the backend by its entry type? At the moment i have one channel with all events (solo and conference-related), each has an entry type like you wrote. Now I will have a very long list of entries in the backend. How to just get the entries of one type?
buckdanny
CC BY-SA 4.0
2021-04-09T15:18:37.510Z
Or is it maybe better to work with two channels instead of one channel with two entry types?
buckdanny
CC BY-SA 4.0
2021-04-09T16:15:27.287Z
I don't think it's possible to filter by entrytype. in this case, 2 channels are better.
Matthias Redl-Mann
CC BY-SA 4.0
2021-04-09T16:16:33.523Z
thanks for your quick help!
buckdanny
CC BY-SA 4.0
2021-04-07T15:56:04.513Z
2021-04-07T15:56:04.513Z
Matthias Redl-Mann
<p>I am working on my first craft project and am wondering how to create the following data structure:</p>
<p>I have a page with a large archive of solo-events (lectures, discussions etc). I think I will use a channel with categories for this.</p>
<p>In addition, there is a second content type: a conference. A conference is a group of solo-events. For example, several lectures and discussions.</p>
<p>The conference as a container has certain fields (picture, text) and the solo-events have other fields (speakers for example).</p>
<p>I wonder what is the best way in Craft to enable this form of container.</p>
<p>Example:</p>
<p>Solo-Events:</p>
<ul>
<li>Event 1 with Speaker a</li>
<li>Event 2 with Speaker b</li>
</ul>
<p>…</p>
<p>Conferences:</p>
<ul>
<li>Conference A</li>
</ul>
<p>-- Event A1 with Speaker c</p>
<p>-- Event A2 with Speaker d</p>
<ul>
<li>Conference B</li>
</ul>
<p>-- Event B1 with Speaker e</p>
<p>-- Event B2 with Speaker f</p>
<p>…</p>
<p>In the Frontend I would like to have:</p>
<p>Speakers-Archive:
I think this will be the easy one. For the speaker I would like to work with a channel and link them to the events.</p>
<p>Solo-Events and Conference-Archive:</p>
<p>A list with all solo-events and all conferences but without the sub-events.
So, this list should contain: Event 1, Event 2, Conference A, Conference B (A1, A2, B1, B2 should be excluded)</p>
<p>I am wondering how to deal with this idea of grouping the events to conferences:</p>
<p>I was thinking:</p>
<ol>
<li><p>Two channels, events and conferences.</p>
<p>All events (solo and conference-related) are in one channel. For a conference (second channel) I can select the events which I want to include. For the archive list I need to exclude all the solo-events that are part of conferences.
This may not be optimal in terms of performance and user experience in the backend</p>
</li>
<li><p>Structure for Confernces and a Channel for Solo-Events</p>
<p>The conferences are the parent elements, the solo events are the child elements.
But how can I create different fields for the parents and children?</p>
</li>
<li><p>Structure with Entry Types:</p>
<p>I wonder if i can work with entry type here as well.
But But how can I bring the Entry Type together with the Hierarchy? So that Parent is always a conference and a children is an Event?</p>
</li>
<li><p>Matrix Field:</p>
<p>The Conferences has a matrix field to store the individual events. But I dont like this approach because I think it would be hard to get all the speaker from a conferences matrix field and combine them with the speaker from the solo-events to get one list with all speaker</p>
</li>
<li><p>Categories.</p>
<p>all events are stored in one channel and I create a Categorie for the Conferences.
It feels kind of wrong-headed because the Conference (in my understanding) is the parent of the event rather than the category.</p>
</li>
</ol>
<p>What do you think?</p>
<p>At the moment I am trying the second approach:</p>
<pre><code>{# get all conferences (parents) (level =1 )  from a structure and merge with all solo-events from a channel#}

{% set entriesConferences = craft.entries.section('conferences').level(1).ids() %}
{% set entriesEvents = craft.entries.section(['events']).ids() %}

{# Combine those IDs #}
{% set entryIdsCombined = entriesConferences | merge(entriesEvents) %}

{# Get all entries (so, no IDs this time), using your IDs, order by date#}
{% set allEntries = craft.entries.id(entryIdsCombined).order('datumUhrzeit desc') %}
</code></pre>
<p>Is there a better (in terms of performance, scalability and user experience in the backend) way to archive this?</p>
<p>I asked this question Oli from the craft team and he gave me an answer that he will hopefully add here as well.</p>
<p>Thanks!</p>

<entries><query>
How to structure data: Solo Events (Lectures) and Group of Events (Conferences)
# How to structure data: Solo Events (Lectures) and Group of Events (Conferences)

(Asked by: username_0 on 2021-04-07)

I am working on my first craft project and am wondering how to create the following data structure:
I have a page with a large archive of solo-events (lectures, discussions etc). I think I will use a channel with categories for this.
In addition, there is a second content type: a conference. A conference is a group of solo-events. For example, several lectures and discussions.
The conference as a container has certain fields (picture, text) and the solo-events have other fields (speakers for example).
I wonder what is the best way in Craft to enable this form of container.
Example:
Solo-Events:

Event 1 with Speaker a
Event 2 with Speaker b

…
Conferences:

Conference A

-- Event A1 with Speaker c
-- Event A2 with Speaker d

Conference B

-- Event B1 with Speaker e
-- Event B2 with Speaker f
…
In the Frontend I would like to have:
Speakers-Archive:
I think this will be the easy one. For the speaker I would like to work with a channel and link them to the events.
Solo-Events and Conference-Archive:
A list with all solo-events and all conferences but without the sub-events.
So, this list should contain: Event 1, Event 2, Conference A, Conference B (A1, A2, B1, B2 should be excluded)
I am wondering how to deal with this idea of grouping the events to conferences:
I was thinking:

Two channels, events and conferences.
All events (solo and conference-related) are in one channel. For a conference (second channel) I can select the events which I want to include. For the archive list I need to exclude all the solo-events that are part of conferences.
This may not be optimal in terms of performance and user experience in the backend

Structure for Confernces and a Channel for Solo-Events
The conferences are the parent elements, the solo events are the child elements.
But how can I create different fields for the parents and children?

Structure with Entry Types:
I wonder if i can work with entry type here as well.
But But how can I bring the Entry Type together with the Hierarchy? So that Parent is always a conference and a children is an Event?

Matrix Field:
The Conferences has a matrix field to store the individual events. But I dont like this approach because I think it would be hard to get all the speaker from a conferences matrix field and combine them with the speaker from the solo-events to get one list with all speaker

Categories.
all events are stored in one channel and I create a Categorie for the Conferences.
It feels kind of wrong-headed because the Conference (in my understanding) is the parent of the event rather than the category.


What do you think?
At the moment I am trying the second approach:
{# get all conferences (parents) (level =1 )  from a structure and merge with all solo-events from a channel#}

{% set entriesConferences = craft.entries.section('conferences').level(1).ids() %}
{% set entriesEvents = craft.entries.section(['events']).ids() %}

{# Combine those IDs #}
{% set entryIdsCombined = entriesConferences | merge(entriesEvents) %}

{# Get all entries (so, no IDs this time), using your IDs, order by date#}
{% set allEntries = craft.entries.id(entryIdsCombined).order('datumUhrzeit desc') %}

Is there a better (in terms of performance, scalability and user experience in the backend) way to archive this?
I asked this question Oli from the craft team and he gave me an answer that he will hopefully add here as well.
Thanks!

**Tags:** entries, query

---

## 1 answers

### Answer by username_1 on 2021-04-07. Score: 3 | Accepted answer

My approach:

* Create one channel for events with different entry types (solo-events, conference-events)
* Create one channel for conferences
* Re-use the date fields in both channels
* That way you can fetch and order events by the re-used date fields from both channels limiting to the entry types of solo-events and conferences with one query. That makes listings, filtering and paging easy.
* Conference-events can be eager-loaded with the query as well
* The entry type for conference-events has a mandatory entry field for the conference
* In the control panel you can show the related conference by adding the field as a column in the overview
* Speakers is another channel or structure being linked from within the conference-events

Why I would not use:

* Matrix: can be easily queried but can not eager load the entry it belongs to
* Category: feels wrong to always add categories for new conferences
* Structures for events: Structure are not 100% user friendly when adding new entries, as they always need to be sorted manually (though there are some improvements in 3.7 coming up)

> **Comments:**
> **username_0**: Thank you very much! I am testing your approach at the moment and I have a question about it: Is it possible to filter the entries in the backend by its entry type? At the moment i have one channel with all events (solo and conference-related), each has an entry type like you wrote. Now I will have a very long list of entries in the backend. How to just get the entries of one type?  
> **username_0**: Or is it maybe better to work with two channels instead of one channel with two entry types?  
> **username_1**: I don't think it's possible to filter by entrytype. in this case, 2 channels are better.  
> **username_0**: thanks for your quick help!  

---

