I am fairly new to Craft but like it's potential but I am not sure the best way to architect a site I am building.

Here is a high level picture of the site. It is a learning site that will have multiple user groups. The portion I am having difficulty with is I have a variety of events. Each event is an event type (type A, type B, etc.) Each one can only be one type of event. The event would have some basic info such as title, description, date, etc. Where it gets difficult is each event will have groups. Within each group there will be sessions. So it could be Group 1, Group 2, Group 3 for groups and then within each Group there would be Session A, Session B, etc. Lastly within each Session there will be items or tasks. Mainly it will be just a description and then an asset to view (pdf, video, doc, etc.)

So it is a deeply nested relationship within each event.

I am sure the best way to structure this. I think I can create separate sections for event, event group, group session and session item and then just try to relate them all to each other. I also think I could use a plugin such as NEO and just use nested matrix to contain everything. Or potentially there is a much better way to do it that I do not see since I am new to Craft.

Some of the other smaller roadblocks. I want to keep track if a user completes a task. I am guessing I will have to build a plugin to do this. I also want to items/tasks to be based on user group level. So maybe there are 10 items/task in a session but only 7 of them are for user group 1 so they would not see the other 3.

Any ideas, tips or advice is appreciated.

  • 1
    Spend a couple hours with this demo site, pay attention to the relations part of the demo, maybe that will give you the 'aha' moment github.com/pixelandtonic/HappyLager – Brad May 10 '17 at 19:40
  • I recommend not to overuse NEO, when you're new to Craft CMS. It's an awesome plugin, but the less you can use a plugin, the better. You should spend some time to investigate the categories and tags of the HappyLager demo site, as Brad mentioned. – Max Strebel May 10 '17 at 21:03
  • I have been playing around with it and will continue to do so as it has given me a few different ways I may be able to achieve this but if there is an obvious best standard way to do this in your mind please give me some high level on what that would be. – Chris May 11 '17 at 13:16

I've built something similar before. I found when I thought about the flow from bottom up, it becomes a little clearer. From your description:

  • Tasks get related to Sessions
  • Sessions get related to Groups
  • Groups are related to Events

For user tracking you may have to write something custom, but it becomes a little more clear if you know that Task A, Task B and Task C was completed by User 12345, and Group Foo contains those tasks. So, now Foo is complete and so on.

A con to this is that you end up having components of your site/app spread out over channels/categories/structures etc. It can be really confusing for a client if having them curate content is the intention.

On Matrix: If you're storing lots of these items within matrices and setup a bunch of relations, it probably adds a layer of complexity to implement user tracking. Additionally with a lot of related/nested/matrix items you run into massive queries that can bog down or cause a system to run out of memory.

Another approach might be to write your own plugin that could maintain all this information for you. Craft is really great at providing a super solid foundation for tons of regular website and web app things. But the real power comes from the extensibility you can add.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.