מדריך למתחילים לשימוש בתמות Discourse

This is a crash course in Discourse theme basics. The target audience is everyone who is not familiar with Discourse themes. If you’ve already used Discourse theme / theme components, this guide is probably not something you need to read.

What are themes and theme components?

A theme or theme component is a set of files packaged together designed to either modify Discourse visually or to add new features.

Let’s start with themes.

Themes

In general, themes are not supposed to be compatible with each other because they are essentially different standalone designs. Think of themes like skins, or like launchers on Android. You can have multiple launchers installed but you can’t use two of them at the same time. Your default Discourse installation comes with two themes


Default

and Dark

Let’s say that’s not enough for you and you want MOAR. Well, you can install additional themes fairly easily. Here are a couple of examples of free themes available here on Meta.

Material Design Theme

Sam’s personal “minimal” topic list design

Vincent

As you can see, your site can look dramatically different based on what theme you select; however, that’s not the end of it. On top of themes, Discourse also supports theme components.

Theme Components

We use the phrase theme-component to describe packages that are more geared towards customising one aspect of Discourse. Because of their narrowed focus, theme components are almost always compatible with each other. This means that you can have multiple theme components running at the same time under any theme. You can think of theme components like apps on your phone.


As always, examples are the best way to describe something, so here are a few examples of theme components available here on Meta

Discourse Category Banners

This theme component takes your existing category details, including name, description, and color and generates a banner at the top of the relevant category pages.

Brand header theme component

This theme component adds an extra top header for branding with your logo, navigation links, and social icons for both mobile and desktop views. Brand logo can be a image or text.

As you can see, theme components have a much narrower focus. As such, they are compatible with each other in most cases. Now you have a general idea of what Discourse themes and theme components are. Let’s dig a little deeper.

Discourse Theme Interface

Let’s look at the interface for themes. Go to your.site.com/admin/customize/themes and you should see something like this:

This is the default theme interface in Discourse. You can do a number of things here:

  • Set the default active theme
  • Choose which themes to make available to your users
  • Create new themes and theme components
  • Import new themes and theme components
  • Add theme components to a theme
  • Modify color schemes
  • Change theme settings
  • Preview a theme

Let’s go through these one by one.

Set the default active theme

The small check mark next to the default theme name indicates that this is the active theme on your site.

Now let’s change the active theme to Dark. Click on the Dark theme and you should see this:

The active theme on your site will be set to Dark. This means that everyone who visits your site will see this:

And the check mark would then move to be next to the Dark theme name indicating that it is the active theme

Choose which themes to make available to your users

It’s nice to be able to set a theme for your site, but you know what’s nicer? Letting your users decide. Discourse allows you to offer different themes to your users allowing them to set the theme according to their preferences. Their choice is limited to their own account and won’t affect your active theme choice or the choices of the other users.

For example, you can set the active theme to the default theme (light) but offer the dark theme as an option. Let’s try and do that now. In the theme interface.

All active themes you have, whether it’s the default theme set on your site or any themes you’ve marked as user-selectable will show here:

However only the default theme will have the green check mark.

Now, let’s try to make the Red theme user-selectable for example.

All you need to do is click on it, and then tick the box that says “Theme can be selected by users”

That’s it! You’ll notice that it automatically gets moved from the inactive theme list to the active theme list

and your users will be able to select whatever theme they prefer by going to

your.site.com/my/preferences/interface

Create new themes and theme components

To create a new theme or theme component, click either of the two “Install” buttons

You’ll then get dialog box. Select the “Create new” option on the lefthand menu. You will need to provide a name for what you want to create and decide whether it’s a theme or theme component.

We’ve sort of covered the basics of what themes and theme components are. If you remember, a theme-component is usually focused on modifying one area of Discourse. Whereas a theme generally covers a number of things. You should also note that a theme can have any number of theme components under it, while a theme-component cannot. Don’t stress about this for now, a more detailed explanation of this relationship will follow later.

Now, let’s say you’ve decided on the name and decided to make it a theme. Well, once you hit the “Create” button, the theme will be created and you would then be able to

  1. Change the name of the theme / theme component
  2. Set or change a color scheme for the theme
  3. Add html / css / js to theme / theme component
  4. Add files or uploads to the theme
  5. Add child components to your theme

Specific customisations are outside of the scope of this guide and so I’ll stop here for this point.

The interface for adding html / css / js looks like this (once you click on #3 above)

Import new themes and theme components

We already have a guide for how to import themes, but I’m including how to do that in here since this guide is supposed to cover all the basics.

To import a theme or theme component, click either of the two “Install” buttons

The “Popular” section will allow you to preview/install from a list of our most popular themes and components.

You can also import theme files from your device or via a the theme repository link. The repository link for each theme is provided by the author on the theme topic. Once you import a theme, all the things we discussed earlier will apply to it. You can set it as default, make it user-selectable and so on.

If you import a theme component, you can also add it to any of your themes. This is covered in detail in the next section

Add theme components to a theme

Let’s say you like the Discourse category banners theme component and want to use it. You would proceed as follows

  1. import the theme from the repository like we discussed above
  2. add it as a theme component to your active / user-selectable themes

You can do that like so:

After importing the component, go to the theme you want to add it to and look for the “Included components” section

This list will show all installed theme components. From there you can add theme components to the theme. Adding the Versatile Banner theme component would look like so

A similar, “Include component on these themes” option exists from an individual component’s page. This allows you to add a component to multiple themes at once

That’s pretty much it. Discourse category banners is now an active component of the default theme. If you also want it to be added to the Dark theme, you would repeat the process of adding the theme component for the Dark theme.

If you’ve set the Dark theme to user-selectable and added the Discourse category banners theme component to it as well, users who select the Dark theme as their active theme will also get the Discourse category banners theme component as well since it’s a “child-theme” of the Dark theme.

You can have an unlimited number of theme components under a theme and like we discussed earlier, they’re usually compatible with each other. So you can do something like this:

And all those components would be active on the default theme at the same time.

Modify color schemes

A color scheme is a palette of colors that you choose to generate the color of the elements in a theme. I won’t go into a lot of details here but will show you how to use color schemes.

Navigate to your.site.com/admin/customize/colors and you will see

From here you can edit color schemes or create new ones. To edit a color scheme, click on it and change the colors to your liking

To create a new color scheme click here

Once you’re done changing the colors, it’s now time to set the color scheme as active in either your active or user-selectable themes. To do so, go to the theme’s page and look here

Theme settings

Discourse themes can have settings. These settings are designed to be an easy way for you to configure a theme or theme component according to your needs. For example the Discourse Button Styles theme has a few settings to allow for easy customisation of how buttons look by simply changing a few values to your liking

Not all themes / theme components have settings but for those that do, they will always show up here. Settings will usually include instructions provided by author that help you determine what changes need to be made.

Previewing a theme

Sometimes you need to see what a theme looks like on your site before applying it. Discourse offers an easy way to preview themes without setting them as active.

While on a theme’s page, click here

and a new tab will open with a live preview of what the theme would look like on your site. You can navigate to different pages and see how everything looks like

the best part about previewing a theme is you can test out changes live without causing any problems on your site in case anything goes wrong.

Additional information

Safe-mode

Discourse has a built-in way to bypass the current active theme in case things go wrong. For example, a javascript error in a component’s code may cause your site to not work properly. To bypass the current active theme simply visit

your.site.com/safe-mode

You would then see

from there you can disable the current active theme, navigate to the theme page and either fix the problem or disable the theme for good.

Getting new themes

The most straightforward way to find new themes and theme components is to check the Theme category here on Meta.

Further reading

Designer's Guide to getting started with themes in Discourse
Developing Discourse Themes & Theme Components
Using Safe Mode to troubleshoot issues with themes and plugins
Structure of themes and theme components
Create and share a font theme component
Create and share a color scheme
Use Discourse Core Variables in your Theme
Add settings to your Discourse theme
Theme Creator, create and show themes without installing Discourse!

If you have any questions, don’t hesitate to ask.

89 לייקים
DiscoTOC - automatic table of contents
Header Submenus
Force Mobile Homepage
Easy Responsive Footer
Changes on the handlebar templates not reflecting on the browser
How can i set topic image' width
Compact Navigation
Scrollable Post Content
Custom Header Links
Hide Users Column
Where can i get discourse themes?
Discourse-webpack: A boilerplate for developing JS-heavy Discourse components
Where to place ad script?
How to make your side have a side-bar and external links
Hide full name if not logged in
Add Likes Column
Override icon / color
Restrict uploads
Kiosk, a self-service theme
Application Files after Digital Ocean Setup
Adding Custom Background CSS
Developing Discourse Themes & Theme Components
Get started with Theme Creator and the Theme CLI
Installing a theme or theme component
Changing layout with themes
Image not filling header container
Configure tag color
Custom Header Links
Is anyone working on a Discourse Wiki?
Trust-Level Avatar Flair
How to add whatsapp in the share button list next to facebook
Floating "New topic" button
Floating "New topic" button
Different landing page for desktop vs mobile theme?
Filter topic with specific tag inside single category
:cn: DiscoTOC 自动内容表格
How to change Discourse splash animation?
Any options for over-riding the username restrictions?
Theme Creator Web Dev Help
Status Page (Atlassian)
Whitelist, allowed iframe
Is it possible to create child themes?
Youtube embed size, revisited
Easy Responsive Footer
How to change paragraph font size?
Compliant Google Login Button
Add Category Column
Auto-Hide Post Editor Preview
Discourse Coloured Text
Alternative Voting Category Style
Discourse Cookie Consent Banner
Raw Post Button
Discourse-affiliate-linker
User card redesign field parity
Advice for starting with Discourse development
Local image ad banners?
Omit Emoji component
Como faço para entender esse fórum? (How do I understand this forum?)
Full name @mentions
Best Workflow for Maintaining Themes?
How to create a theme (if I am a pure end user)
Filtered Topic Lists
Discourse Popular Tag Sidebar
Auto-Linkify Words
Place for total coding beginners to learn how to customise?
Can I install an external application from github running on discourse
Topic List Sidebars
Newbie help accessing code
Per-category Terms of Service
Fetch third party data for topic list
DiscoTOC - automatic table of contents
Private Message Can't Be Reached with private messaging disabled
Share theme (component) translations
DiscoTOC - automatic table of contents
Categories Layout Override
Return to start of topic
Group specific tool bar
Theme Stelpolva: A discourse rounded theme based on Default Theme
Custom Hamburger Menu Links
Desktop to Mobile View Banner
Link from inside the topic to itself
Custom user menu tab
Discourse Tag Sidebars
Add To Home Screen (iOS, iPadOS)
Moonclaw Theme port
Created Topic Sort
Discourse Tag Cloud
Featured Flip Cards
Main banner doesn't appear when theme was changed
Codeblock Theme Picker
Hide Auth Method
Theme-Component v Plugin: What's the difference
Can I turn off location?
Blog Post Styling
Extended About Page
Category Hider Theme Component
Category Previews
Wide image extending until search icon?
Expanded Create Topic Component
How to add Google Custom Search Engine to Discourse
DiscoTOC - automatic table of contents
Inline PDF Previews
How do I add category banners?
FKB Pro - Social theme
What's the fastest and easiest way to add a persistent javascript file or snippet
Banner opacity and disabling profile pictures / avatars
Wordpress in header, Discourse in footer ? Both sticky
Topic List Previews (legacy)
Add Text In Header Beside Logo
How to remove borders in tables?
Custom Homepage for Groups
Custom header colour and category icons and login button
Discourse Web Page Watermark
Removing all categories (or just "uncategorized") from hamburger menu
Hide Likes For New Users
How to remove the number of months in the category section
Styling front page category title & nav container background
Category descriptions not showing up on mobile
How customize the appearance of sections like Amazon?
Selectively hiding numbers
(old) method for adding languages to highlight.js on Discourse
Homepage (sub)category display - lots of whitespace
About the Theme category
About the Theme component category
How to update Theme Components when running on Ubuntu
Javascript code snippet injection for cookie tracking
🎀 Neomorphism, a modern theme for Discourse
Dracula a Dark Theme for Discourse
How can I add a menu item
Adding statcounter code
Grogu, a theme inspired by "The Mandalorian"
Versatile Banner
Left side hamburger menu on mobile
MD Composer extras
How to add a simple Banner
Custom Top Navigation Links
Personal Message Bubbles
Custom Header Links (icons)
Discourse for self hosting
Full Row Bulk Select
Make "New Topic" button more prominent
Marquee / news ticker
How can I add a analytics script into the header of my community?
Display replies and likes count in mobile view
Help needed with theming and logo
Compose Center
Wikified Posts Component
Discourse Coloring Tag
Welcome Link Banner
CSS username colors only working for admin/moderators?
MD Topic List component
MD Topic List Mobile component
Review with reason
HTML tags showing in banner and don't know where to change it
New PM Dropdown Button
:classical_building: Rome, a theme inspired by ancient roman manuscripts
How to add a script at the beginning of page header?
Recommendations on layouts? A way to preview changes?
Is it possible to change Topic Title prompt for a category?
Need a plugin coded to allow certain css codings in forum
Poll Defaults
Timeline bookmark button
Graceful Theme
Material Design Theme
Sublime Theme
Discourse hamburger tags
IFrame Lightboxes
Changing theme color for the forum
Change Excerpt of topic to go to latest post instead of that specific message
Density Toggle Component
How do I test drive UI changes?
How do I test drive UI changes?
Discourse svgbob
Colored Tag Styles
Hibiscus Theme
Fully Theme
Group Categories Page Override
Voice Recorder Component
Discourse Show Fullname in Mentions
Header Locale Selector
Mint Theme
Top Contributors Sidebar
Homepage Feature
Customized Inline Codeblocks
Profile Photowall
User Portfolio
Category Banners
Matomo Analytics
Colorful Categories
Net Promoter, Satisfaction scoring?
What is the name of this theme?
Social Share
Discourse Gifs
Kanban Board
Topic List Excerpts
Unanswered Filter
Discourse Solved Quote Customization
Post Badges
Featured Tiles
Inky Theme
Reply Template
Trendy Login
Topic Author
Placeholder Forms
Remove Dashes from Tag Names
Jitsi Video Conference
Brand Header
Show Original Poster Avatars
Categories Tag Column
Timeline with labelled step by step sections - how is this achieved?
User Card Directory
Tag Icons
Tag Banners
Guest Gate Theme Component
Offline Indicator Theme Component
Showcased Categories
Signup Banner
Submit from Preview (Mobile)
Insert Video
Hamburger Theme Selector
Google Fonts
Hide Muted Categories
Category Groups
Categories Tracking Toggle
Gated Topics in Category
Halloween Decorations :ghost:
User Field Prompt
Whereby Video Meetings
Sticky Avatars for Mobile
Change the Like Icon to :+1:
Right Sidebar Blocks
DarkPixlz's Modern Theme
Sticky New Topic Banner
Clickable Topic
Topic Count in Category Boxes
Group Timezones
Remove Name Suppression on Posts
Warning banner for old Android devices affected by Let's Encrypt changes
CSS Classes for Current User's Groups
Dice Roller
Baidu Search
Avatar Size and Shape
Discourse Icon
Topic Status Filter
GitHub Status Indicators
Topic Footer Buttons
Thin Header
Sam's Simple Theme
Optional Mobile Title Header
Custom Code
Intercom Widget
Discourse Mermaid
Custom Category Boxes
Discourse Classic Theme
Topic List Thumbnails
Unformatted Code Detector
Dark/Light Mode Toggle
Fakebook Theme
Discourse Docs Card Filter
Add a custom header with a dropdown menu
Hide ignored users' topics
Contributing to Discourse
Designer's Guide to getting started with themes in Discourse
Sidebar Theme Toggle
Blackout - A Theme For OLED Displays
Issues adding CSS/JS component: Robustifying links to preserve link functionality
Horizontal loading slider
Composer Footnote Button
Account Deletion Request
Developer Toolbox
Desktop PWA Navigation
Lightweight Topic List Container
Customize the header with links, icons, or menus
Disable Likes
Buttons for Scrolling to the Top/Bottom of Topics
Advanced Search Banner
Floating Navigation Controls and Desktop Navigation Bar for Mobile
Composer tip under specific tag topics
Prevent users from changing their Full Names
Replace Discourse's default SVG icons with custom icons in a theme
Changing views to creating date?
DiscourseConnect Signup Button
Notification Banners
Alternative User PMs Button For Admin
How to use themes?
Discourse Custom Width
Clickable links in website and bio for TL0 newuser
Restrict Category Editing for Topics
Cookie Consent, GDPR, and Discourse
Allow users to block keywords
Customize Your Site Branding
Any existing theme with categories on top as cards?
How do I put gradient on thin icons?
How do I put gradient on thin icons?
Alien Night Theme - A free Dark Theme for Discourse
Arranging Categories in order of number of Topics
How to show user's name next to avatar in the navigation when logged in?
Hide staff from /about page
Breadcrumb Links
Integrate Appzi feedback tool to front-end of discourse
Very Modest Theme
Developing Discourse Themes & Theme Components
Header Categories Navbar
Report Content to Group
Open In Script Editor
Hide sidebar from anon users
Sidebar User Field Toggle
Avid Reader Theme
Minimizing Maintenance on Theme Customizations
Air Theme
Minima Theme
Share Link Shortener
Twitter Native Embed
Adjust the post-voting button to the bottom
Pinboard, a simple UI theme
Clean, A clean style discourse theme
Prefilled composer link generator
Hiding GUI elements for new users (less overwhelming)
Topic List Author
App Promoter
Topic List Stats
Show both OP and last reply on mobile
Image comparison slider
Announcement Bar
Featured Categories Header
I want to learn how to program for Discourse
Featured Topics
Discourse Nav Item Icon / Emoji
A reddit-ish theme for Discourse
Homepage Toggle
Chat Sidebar
Change share icon by OS
Multiple Custom Profile Links
Image Alignment and Grid
Mint Theme
Header Glass
Topic List Item Click Animation
Twemoji Icons
Custom embedded replies
Close Composer On Page Change (mobile)
Chat – whatsapp bubbles
Hide details button style
How can one add a toggle button to the post menu and implement an action for that toggle button in a Discourse plugin?
Hide Lock Badge Icon
Targetable Color Schemes
Air Theme
Author Badge for Topic Posts
Highlighter Composer Button
Navigation (sidebar) menu display control
Rainbow Header Gradient for Discourse
Icons next to categories
How to enable side navigation?
Long picture adaptation
F NAV - Mobile Navigation Tabs
Discourse Full-width component
QR Code Shareables
Discourse Stickers
Enable Dev Tools Button
Loading Slider to Spinner
Composer Highlighted Button
Composer Inserted and Deleted Text Formatting Buttons
Solved Topic Badge
Air Theme
Is there a way to remove the pop-ups when making a new topic?
Smooth Scroll Top on Homepage
Stat Banner
Usercard: show leaderboard rank
Featured Lists
eBay EPN Affiliate Link Generator
Banner Featured Links
How do I go about making a very customized theme?
Moving to a Single Category Style Site Setting
How can forum admins edit the colour of topics that have been read?
Character count when writing description
Need help integrating code wrote on Edittext to the Discourse
Transit - A Public Tranportation theme
Custom Profile Link
Search section like on Reddit?
How to resize 'Modern Category + Group Boxes' thumbnail via CSS
Category List with Banners
Watermark Image
How can I create a Discourse that's just like Stemaway.com?
Minima Adjustments for Topic Cards
How can I remove the milliseconds indicator (mini-profiler) at the top right?
Add groups to the /about page
Horizon Theme
Missing anchor links in certain TOC topics?
Changing the header font for Custom Header Links
How can I change the global font size?
Missing anchor links in certain TOC topics?
Getting ‘undefined method `kilobytes’ for “1024”:String’ when installing theme component
How can I edit My Login Page
Discourse Modal Grip
How do I install a custom theme on my Discourse instance?
Reader Mode
Discourse OrgChart
Follow Category Button
New Topic Header Button
Editor Preview Position
Missing anchor links in certain TOC topics?
Customize new topic button text
Topic Cards
Fakebook Theme
Ghost Theme
Zeronoise Theme
Topic Map Stats Icons
Category Icons
Override Signup CTA requirements
Making custom CSS changes on your site
NateDhaliwal's Theme
Code-block line numbers
Classic About Statistics
Can We Implement the Discourse Central Theme in Our Discourse Hosted Community
AI Bot - New Question Modal
Discourse Persistent banner
Installing a theme or theme component
Custom Logo Link
Creating a banner to display at the top of your site
A TC of fun: Discourse Confetti Clicks
Related category permissions
How to add whatsapp in the share button list next to facebook
Unstar all badges
AI Post Analyzer for Chat
Be the first to reply
Indented / Nested Sidebar Categories or Subcategories
Add a Logout Button in Header for Discourse Themes
Profile text is yellow
Group navigation sidebar menu sections
Insert Model 3D
Quick Profile Links Menu
Normalized Profile Links
:page_facing_up: Copy Post Component
Pull to Refresh for iOS App
Homepage Blocks
Custom Lightbox - modern, swipe gestures, fullscreen mode and more
Custom Components -- add button or text at any plugin outlet
Emoji Fluff
Adding preview screenshots to Discourse themes
Quote Callouts
Canvas Theme Template
Pyx's Modern Theme
Discourse Graph (Plotly) Embed
Post Notice Visibility Control
Heroes - Fantasy Theme
Custom User Menu
Advanced Header Search
Alternate New Topic Button (per category)
Custom Topic Sort Order Button
Quick-add Tags To Topic
Discourse-fully light/dark下不同的颜色变量如何设置并生效
Sidebar Color Palette Toggle
Customizable Navbar Component
Filter Favorites
Introducing core themes
Asking for feedback: Tag Reveal Component in Topic Lists - Expand/Collapse tags in topic lists
Enable Notification Banner
Discourse Featured User
Setting up light and dark mode color palettes
Default Chat Channel
Glacier Theme
Discourse Qingwa Timelines - Custom BBCode for Beautiful Timeline Layouts
Hidden User Fields
Restricted reactions (like) by group
Messages section for sidebar
Editing Theme design
Why am I finding Discourse so difficult to customize?
Air Theme
🌐 www theme
Air Theme
Air Theme
Tiles Image Gallery
Topic List Tooltips
Advanced Hero Component
Discourse Birthdays & Anniversaries Today (Banner)
Mobile Category List Adjustments
House Ad Templates
Red-light theme
Scroll to Top Component
Is it possible to edit plugin components?
Embed whole forum
Land on Group Messages Component
Theme Developer Quick Reference Guide
Hide Topic Navigation With Timeline
Require Edit Reason
Video Upload to YouTube and Vimeo using Theme Component
Fixed-Position Topic Edit Button
Made some changes I cannot revert
Discourse Post Image Carousel
Applying a custom header to Discourse site
Blog Post Styling
Which is Better? Discourse or Flarum?
Floating left sidebar
Add custom content that only appears on your homepage
What is the purpose of the "Convert" button with themes?