Appearance
Discussion module overview
WARNING
This module is very old, we have a lot of N+1 DB query issues for it. The Code quality of this module is below our current standards.
NOTE
Refactor of this module from Discussions to Conversation is in progress. In first rollout, we've updated the module name on front-end only.
Introduction
The Discussion module is a part of our platform which is responsible for communication between members. This communication takes place in discussion topics, Local Groups, Meetups, Lesson Items, and Design League private chats.
Engaging in discussions on IxDF enhances members learning experience by providing a platform to:
- Connect with peers and professionals worldwide.
- Share insights and receive feedback.
- Stay updated on industry trends and best practices.
Discussion
A Discussion is a conversation between members of IxDF that can be private or public, being versatile enough to be associated with any business entity. For that reason discussions exist in various forms in our platform and can be categorized in the following types:
Community Discussions
Community Discussions are platform-wide forums where members from all over the world can start and participate in conversations on various topics related to design, user experience, and more.
Lesson Item Discussions
Discussions about a specific Course Lesson, they enable learners to discuss specific lessons, ask questions, and deepen their understanding of the material.
Local Group Discussions
Discussions about a Local Group, they allow members within a local community or with shared interests to connect, collaborate, and organize events or meetups.
Meetup Discussions
Discussions about a Local Group Meetup, they enable members to discuss the details of a specific event, ask questions, and coordinate logistics.
While the Discussions exist in these different forms, they are built in a scalable way so that virtually any model can have a discussion (see more bellow).
Additionally, Discussions have visibility levels that can affect who can see/participate in them:
- Public - Discussion is open for everybody
- Private - Discussion is open for some members (e.g. private chat) only
- Member-only - Discussion is open for site members only
Discussion Message
Discussion is the aggregator of all the Discussion Messages. Discussion Messages can be posted in a given discussion through an RTE (Rich Text Editor).

Discussion Messages can also be replied to. A reply will still be Discussion Message, that is linked to the originator.
TIP
Multiple level replies on a given Discussion Message are currently not supported!
To boost engagement and visibility, members can also "like" Discussion Messages. For now, Discussion Messages Likes simply reward the member with a notification, and allow members to sort by popularity. There's room in the future to add specific distinctions regarding this feature.
Discussable
Discussable is an interface that can be implemented by any model in the system. It allows the model to have a discussion associated with it. Discussable models are required to have:
- A slug - The slug of the model is used to identify the discussable item. It's usually defined by their kebab case name. E.g:
LocalGroupwould have a sluglocal-group - A title - The title of the model is used to display the discussable item in the discussion.
- A discussion subject - The subject of the discussion is used to display the discussion in the discussion list.
- A discussion message url - The URL of the start of the discussion or the URL of the most relevant discussion message in the discussion.
- Should display messages times - A boolean that indicates whether the discussion messages times are visible or not.
Discussion Listable
A Discussion Listable is an interface that can be implemented by any model in the system. It allows the model to have a list of discussions associated with it. It works similarly to Discussable but allows for multiple discussions to exist under the associated model.
Discussion Category
A Discussion Category is an example of a Discussion Listable, and it has special meaning for Community Discussions. Discussion Categories correspond to the different categories presented in the community section. It allows for a better organization of Community Discussions and helps members find and create discussions on the appropriate subsections.
Local Group
A Local Group is another example of a Discussion Listable, organizing Local Group Discussions by the context of the Local Group's city.
Hierarchy
To have consistency throughout the system and also to give an opportunity to scale at will, a new hierarchy was introduced.
1st step: Discussion Messages
The core of the discussion module is the first step: Discussion messages. The interactions between members and the discussion module will happen at this step. A member can post a discussion message where the member has correct permissions. Members can also post replies to or like discussion messages. Replies are also defined as discussion messages.
2nd step: Discussable Entities
One or more discussion messages can belong to a discussion. What is a discussion? A discussion is actually an abstract concept which connects a group of discussion messages to a discussable item. What is a discussable item? It can literally be anything: any Model on our platform. The only limitations are that a discussable class should implement a Discussable interface and can have only one related discussion (if you want to have more related discussion, see step 3). For example, let’s say there is an example Event object which will be held at Starbucks Vienna. There can be a discussion at this discussable Event. Or, say, we have a topic which we want to discuss, and it’s about How to create better UX with flat design principal? There can be a discussion on this discussable Topic which gets us to the third step.
Discussion Details
The Discussion class acts as a bridge linking discussable items with their corresponding messages. It features attributes that define both its visibility and its creator within the system:
- visibility: An enum that defines who can see the discussion, such as
public,private, ormembers-only. - creator_member_id: This optional attribute stores the ID of the member who initiated the discussion. It is typically populated in various scenarios, including
DiscussableGroup,DiscussionTopic, andDiscussionListItem. Currently, the only exception is for discussions created forLessonItem.
3rd step: Discussion Listable Entities (optional)
If you want to attach more than one discussion to your entity, then you should create some sort of list of discussions. And your model should implement DiscussionListable interface. For example, every DiscussionCategory has many topics.
When creating a topic discussion in DiscussionCategory, the system creates two things: A discussable topic (which gets the discussion title as its title), and a discussion message (which gets the message text). Even if the member removes the message afterward, the topic will remain and others can post their messages into it. This is a clear separation of topics and discussion messages. Actually, you can think of Topics as Events with regard to the example in the 2nd step. Every event can have ONE discussion going on inside it. It’s the same for topics. Every topic can have ONE discussion going on inside it. But since we have a lot of topics in a category, which should be listed under a discussion category, list discussions were introduced.
For a full top-down example:
- There are 12 discussion categories.
- There is a discussion category named Mobile UX.
- There are discussable topics listed under Mobile UX.
- One of those topics is titled as How to create better UX with flat design principal?
- There are discussion messages that have been posted to the topic.
This is the 3-step hierarchy. You can theoretically create a discussion under any Model inside the platform, and then you can also gather those discussions to be listed under any other class. This is a scalability at its peak.
Implementing a new Discussion Type
As explained above, virtually any IxDF model can have a discussion. This topic explains what to do in order to enable a model to be "discussable", that is, to have an associated discussion (or to be the target of a discussion).
Implement Discussable interface
To implement the Discussable interface a model needs to implement the following methods in PHP:
php
public function getSlug(): string
public function getDiscussionSubject(?Member $member = null): string
public function getDiscussionMessageUrl(?DiscussionMessage $message, bool $isAbsolute): string
public function getDiscussionTitle(): string
public function shouldDisplayDiscussionMessagesTime(): boolThese methods define the basis of the discussable in Meetups. Additionally, the model can now declare its relationship with the discussion model:
php
public function discussion(): MorphOne
{
return $this->morphOne(Discussion::class, 'discussable');
}Notice the MorphOne relationship, this is because the discussion can be associated with any model in the system.
Implement DiscussionListable interface
To implement a DiscussionListable interface a model doesn't need to implement any methods. The model can declare its relationship with the discussion list by using a MorhpToMany relationship:
php
public function discussions(): MorphToMany
{
return $this->morphToMany(Discussion::class, 'listable', 'discussion__discussion_list_items');
}Notice that the relationship is MorphToMany because the model can have multiple discussions associated with it.
NOTE
The relationship is established through DiscussionListItem pivot table. This table is used to store the relationship between the DiscussionListable and the Discussions