Why am I finding Discourse so difficult to customize?

If I want to edit the css I have to create a component, create a css file and fine it works. Now if I add another component for example ‘Discourse Topic Cards’ and then go back to the custom css file, apply the changes, click save and then refresh the page, the custom css does not apply.

Also, why is there not a way to edit templates in the admin area? If I want to edit the ‘Discourse Topic Cards’ templates I have to ssh into the discourse docker and edit what to make changes?

Is WordPress more familiar to you? If is then you understand this easier: you never edit directly core, plugins or themes because you will loose all modifications when next update happends.

So many of those difficulties aren’t actually from Discourse, but how the world works :smirk:

5 Likes

You might need to add !important to your CSS so these rules take priority over others defined elsewhere. This situation is expected when several components are loaded in a specific order. That’s a common problem and not necessarily specific to Discourse. I don’t know if we could have a weighing system to tell “that component should load at the end,” but that sounds really unmanageable.

That’s why it’s important for theme and theme components to not use !important in the CSS unless it’s absolutely necessary.

If you want to edit a remote theme component, feel free to fork it on GitHub and create your version. That’s the easiest way! However, you won’t receive any updates from the original version. You can’t edit remote components because your customization might clash with the updates (and it’s a nightmare to handle).

Customizing Discourse is fairly accessible. It depends on what you’re expecting as customization, though. What are you trying to achieve here? Maybe we can help. The discourse team is usually open if some area welcomes customization facilities.

1 Like

I have run websites online for a number of years, I think if you can create something a bit more unique that tends to do better. I would like to customise the ‘Discourse Cards Topic’ template and include posters, replies, views, and activity stats from the generic topics list.

What you can do:

  • Request features (on the appropriate topic, like you did)
  • Posting in marketplace if you can
  • Learn how to code and how theme components work (see theme developers) and don’t hesitate to ask dev for any help!
3 Likes

Is there any documentation for coders to read?

Here are some resources you might find interesting to familiarize yourself with Discourse:

Take your time to read! Some guides contain links to external guides as well.

If you have questions, ask dev :+1: .

5 Likes

If you want to add changes on top of the the Discourse Topic Cards theme component, you can do this:

  1. Install Discourse Topic Cards and add it to your active theme
  2. Make a new theme component
  3. Add the new theme component to the active theme too

You don’t have to ssh into the server or change anything in the source code, or fork the repo.

For an example, here is what I did to make some changes to Discourse Topic Cards for the theme Minima:

This way, you still get new updates from the theme, and all the theme components are organised and separated (so you can easily disable/enable for debugging)

But yes I do think this process could be explained a bit better for admins.