# When to use a plugin vs theme component?

**URL:** https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052
**Category:** Development
**Tags:** css
**Created:** [February 28, 2024, 11:22am UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052 "2024-02-28T11:22:51Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![maaatt](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@maaatt](https://meta.discourse.org/u/maaatt)
#### Post date: [February 28, 2024, 11:22am UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/1 "2024-02-28T11:22:51Z")

</div>

I need to do little changes to some views:  
Eg:

- change the datetime format to extended one (DD/MM/YYY HH:MM)  

- add a tooltip to long category titles  

- view long category titles on two rows  

Do I need to create a plugin for every change? even if is really small like only css?  
Thanks for your help.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [February 28, 2024, 11:35am UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/2 "2024-02-28T11:35:58Z")

</div>

No, plugins are only required if you intend to change the back-end.

If it’s just a local change you can go to Admin → Customize → Theme and enter changes into a new Theme Component, then add it to your current Theme.

Take a look at [https://meta.discourse.org/c/documentation/theme-developers/127](https://meta.discourse.org/c/documentation/theme-developers/127), especially:

> [@Developing Discourse Themes & Theme Components](https://meta.discourse.org/t/beginners-guide-to-developing-discourse-themes/93648):
>
> Discourse Themes and Theme Components can be used to customize the look, feel and functionality of Discourse’s frontend. This section of the developer guides aims to provide all the reference materials you need to develop simple themes for a single site, right up to complex open-source theme components. This introduction aims to provide a map of all the tools and APIs for theme development. If you prefer a step-by-step tutorial for theme development, jump straight to: Themes vs. Theme Compon…

---

<div class="post-metadata">

### Author: ![maaatt](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@maaatt](https://meta.discourse.org/u/maaatt)
#### Post date: [February 28, 2024, 2:50pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/3 "2024-02-28T14:50:16Z")

</div>

thanks!  
So if I need to change a label or add a tooltip I need to create a theme but if I need to add a new column to a page (eg: the topic list) I need to create a plugin?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [February 28, 2024, 2:54pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/4 "2024-02-28T14:54:41Z")

</div>

The distinction is this:

- If you need to change the API, e.g. any data in .json route, changes to authorisation, back-end processing of data, you need a plugin
- For many front end changes that don’t need different data, you only need a TC. ie a lot of presentational changes, or any logic in javascript that is not sensitive.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 28, 2024, 5:28pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/5 "2024-02-28T17:28:43Z")

</div>

And a gray area (which doesn’t apply here, I think) is if you need data that is not available (like user custom fields) you could either use AJAX to pull that data with javascript when you need it, or have a plugin that adds the data to the serializer.

---

<div class="post-metadata">

### Author: ![maaatt](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@maaatt](https://meta.discourse.org/u/maaatt)
#### Post date: [March 1, 2024, 3:05pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/6 "2024-03-01T15:05:23Z")

</div>

ok thanks. In the guide I don’t undestand how can I setuo and import a TC locally, there’s only an example for a remote one.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [March 1, 2024, 3:10pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/7 "2024-03-01T15:10:53Z")

</div>

I would suggest using this wonderful tool, to create TC easily locally:

> [@Install the Discourse Theme CLI console app to help you build themes](https://meta.discourse.org/t/install-the-discourse-theme-cli-console-app-to-help-you-build-themes/82950):
>
> The [[discourse] Discourse Theme CLI](https://github.com/discourse/discourse_theme) is a ruby gem that allows you to use your editor of choice when developing Discourse themes and theme components. As you save files the CLI will update the remote theme or component and changes to it will appear live! Installing To play with it, make sure you have Ruby 2.5 or up installed. If you are on Windows, you have 2 options: Option 1: [Windows Subsystem for Linux](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux). Windows 10 has access to a full Linux environment, you can use it to install …

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 1, 2024, 3:31pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/8 "2024-03-01T15:31:45Z")

</div>

Unless you have a very small CSS change, I’d recommend using a remote theme or the CLI tool.

But if you click the “install theme” dialog will allow you to create a theme (or theme component if you do it on the component page)

---

<div class="post-metadata">

### Author: ![maaatt](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@maaatt](https://meta.discourse.org/u/maaatt)
#### Post date: [March 1, 2024, 3:34pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/9 "2024-03-01T15:34:29Z")

</div>

inside the category topics list I need to add a new column with the “created\_at” column and change the date from “tiny” to extended (eg: DD/MM/YYYY HH:MM)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 1, 2024, 4:14pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/10 "2024-03-01T16:14:37Z")

</div>

If you want to add new stuff to a template, I would start with [GitHub - discourse/discourse-theme-skeleton: Template for Discourse themes · GitHub](https://github.com/discourse/discourse-theme-skeleton), but I don’t know how to go about adding a column there. I guess there’s some javascript magic you could do, but that’s not my wheelhouse.

You know that you can see that information if you mouse-over, right?

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/1/3/313662d89e286b67f006ad5aef7a648ab8f62d79.png)

Also see [Plugin outlet locations theme component](https://meta.discourse.org/t/plugin-outlet-locations-theme-component/100673), but there’s no plugin outlet there.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [March 1, 2024, 4:28pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/11 "2024-03-01T16:28:10Z")

</div>

> [@pfaffman](#):
>
> but there’s no plugin outlet there.

You have these plugin outlets: `topic-list-after-columns` and `topic-list-header-after`.

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/raw-templates/list/topic-list-item.hbr#L90](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/raw-templates/list/topic-list-item.hbr#L90)

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/raw-templates/topic-list-header.hbr#L27](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/raw-templates/topic-list-header.hbr#L27)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 1, 2024, 4:45pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/12 "2024-03-01T16:45:43Z")

</div>

> [@Arkshine](#):
>
> You have these plugin outlets: `topic-list-after-columns` and `topic-list-header-after`.

Good catch. It seemed wrong that there was no outlet there. I guess the theme component just doesn’t show it.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 1, 2024, 5:26pm UTC](https://meta.discourse.org/t/when-to-use-a-plugin-vs-theme-component/297052/13 "2024-03-01T17:26:39Z")

</div>

The plugin outlet locations theme component does not show raw outlets at the moment.

This theme component shows you how to add a column [GitHub - discourse/discourse-add-category-column · GitHub](https://github.com/discourse/discourse-add-category-column)
