Splitting between plugin and theme

We are developing a plugin that serializes a new attribute (an image) in the topic list (using TopicListItemSerializer). However, it doesn’t make sense displaying this image in the context of the regular Discourse UI. This image will be consumed by our own theme – which will make our site very different from a the default Discourse installation.

My initial idea was to create a plugin that just provides this attribute in the serializer, and leave for the theme to consume and display the image. Would this make sense, or the plugin should also include the code to display the image in the UI?

Your initial idea is fine, splitting into a plugin and a theme will give you the flexibility to make updates in the theme and update your site without needing to redeploy (the other option, having all the UI code in the plugin will require a redeploy when you make changes).

8 Likes

Thanks for the reply, @pmusaraj!