discourse/app/controllers/admin
Martin Brennan 19af83d39e
FEATURE: Themeable site settings (#32233)
This commit introduces the concept of themeable site settings,
which is a new tool for theme authors that lives alongside theme
modifiers and theme settings. Here is a quick summary:

* Theme settings - These are custom settings used to control UI and functionality within your theme or component and provide configuration options. These cannot change core Discourse functionality.
* Theme modifiers - Allows a theme or a component to modify selected server-side functionality of core Discourse as an alternative to building a plugin.
* Themeable site settings (new) - Allows a theme (not components) to override a small subset of core site settings, which generally control parts of the UI and other minor functionality. This allows themes to have a greater control over the full site experience.

Themeable site settings will be shown for all themes, whether the theme
changes
the value or not, and have a similar UI to custom theme settings.

We are also introducing a new page at
`/admin/config/theme-site-settings` that
allows admins to see all possible themeable site settings, and which
themes
are changing the value from the default.

### Configuration

Theme authors can configure initial values themeable site settings using
a section in the `about.json` file like so:

```json
"theme_site_settings": {
  "search_experience": "search_field"
}
```

These values will not change when the theme updates, because we cannot
know if admins have manually changed them.

### Limitations

Themeable site settings are only really intended to control elements of
the UI, and when retrieving their value we require a theme ID, so these
limitations apply:

- Themeable site settings cannot be used in Sidekiq jobs
- Themeable site settings cannot be used in markdown rules
- Themeable site settings will be cached separately to client site
settings using theme ID as a key
- Themeable site settings will override keys on the `siteSettings`
service on the client using the application preloader
- `SiteSetting.client_settings_json` will not include themeable site
settings, instead you can call `SiteSetting.theme_site_settings_json`
with a theme ID

### Initial settings

There are only two site settings that will be themeable to begin with:

* `enable_welcome_banner`
* `search_experience`

And our new Horizon theme will take advantage of both. Over time, more
settings that control elements of the UI will be exposed this way.
2025-07-16 11:00:21 +10:00
..
config FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
admin_controller.rb DEV: Drop WithServiceHelper 2024-09-05 09:58:20 +02:00
admin_notices_controller.rb DEV: Make params explicit for services in controllers 2024-10-03 16:56:39 +09:00
api_controller.rb DEV: Require at least one scope for API key granular mode (#31253) 2025-02-10 13:22:08 +08:00
backups_controller.rb FIX: improve "read only" modes (#33521) 2025-07-10 09:08:00 +02:00
badges_controller.rb UX: Easily toggle badges in admin badge list (#20225) 2023-02-09 11:36:27 -08:00
color_schemes_controller.rb DEV: enable Foundation and stop Default (#33610) 2025-07-15 11:16:11 +08:00
dashboard_controller.rb FEATURE: Allow admins to force refresh "What's new?" (#29911) 2024-11-27 09:40:55 +10:00
email_controller.rb DEV: Add e-mail site settings to e-mail admin page (#32214) 2025-04-08 18:59:50 +08:00
email_logs_controller.rb FIX: bug when skipped email logs are filtered (#33557) 2025-07-11 08:55:51 +08:00
email_styles_controller.rb FEATURE: customization of html emails (#7934) 2019-07-30 15:05:08 -04:00
email_templates_controller.rb FEATURE: send email to deleted user (#31947) 2025-03-24 14:45:25 +08:00
embeddable_hosts_controller.rb UX: admins embedding page follows admin ux guideline (#30122) 2025-01-06 13:01:08 +11:00
embedding_controller.rb UX: admins embedding page follows admin ux guideline (#30122) 2025-01-06 13:01:08 +11:00
emoji_controller.rb DEV: Move admin config pages out of /customize/ sub-route (#30511) 2025-01-02 09:13:11 +10:00
form_templates_controller.rb DEV: Show form templates in the composer (#21190) 2023-05-29 14:47:18 -07:00
groups_controller.rb DEV: Add dedicated admin groups page (#32377) 2025-04-22 11:23:25 +08:00
impersonate_controller.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
permalinks_controller.rb FIX: Permalink.create didn't work as expected anymore (#29895) 2024-11-22 21:11:26 +01:00
plugins_controller.rb FIX: Don't allow access to plugin page if plugin is not visible (#26431) 2024-04-02 16:26:15 +03:00
reports_controller.rb DEV: Refactor reports index into service (#31667) 2025-03-11 14:36:06 +10:00
robots_txt_controller.rb FIX: Show true content of robots.txt after restoring to default (#24980) 2023-12-20 23:00:37 +03:00
screened_emails_controller.rb SECURITY: Moderators cannot see user emails. 2024-12-19 13:13:18 -03:00
screened_ip_addresses_controller.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
screened_urls_controller.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
search_controller.rb DEV: Refactor reports index into service (#31667) 2025-03-11 14:36:06 +10:00
search_logs_controller.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
section_controller.rb DEV: Add a skeleton for section landing page & items (#28477) 2024-10-02 12:19:38 +10:00
site_settings_controller.rb FEATURE: porting type object to site settings (#32706) 2025-05-13 14:30:24 -03:00
site_texts_controller.rb FEATURE: Allow showing site text search in selected locale (#28453) 2024-08-26 11:25:36 +10:00
staff_action_logs_controller.rb FEATURE: Log tag group changes in staff action log (#28787) 2024-09-09 10:50:48 +08:00
staff_controller.rb DEV: Drop WithServiceHelper 2024-09-05 09:58:20 +02:00
themes_controller.rb FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
unknown_reviewables_controller.rb FEATURE: Gracefully handle unhandled reviewables (#31118) 2025-02-05 14:38:45 +11:00
user_fields_controller.rb DEV: Modernize admin user fields (#29843) 2024-11-25 11:54:43 +08:00
users_controller.rb DEV: revert admin users list change (#32723) 2025-05-15 09:48:01 +02:00
versions_controller.rb Refactor admin base controller (#18453) 2022-10-31 12:02:26 +00:00
watched_words_controller.rb FIX: Ensure uploaded watched word CSVs are converted to utf-8. (#32263) 2025-04-11 16:12:45 +10:00
web_hooks_controller.rb FEATURE: Add Mechanism to redeliver all failed webhook events (#27609) 2024-07-08 15:43:16 -05:00