弃用搜索横幅主题组件

Over the past few months, we have been working on a welcome banner feature that is part of Discourse’s core product. This core welcome banner feature greets new and returning visitors to your community and makes it easy for them to search for content that’s relevant to their needs and interests. With this new core banner in place, we are now deprecating the Search Banner theme component to reduce the complexity of our product offerings and ensure all Discourse users benefit from continued improvements to the core feature.

In this topic, we’ll cover what deprecation means for current users of the Search Banner theme component.

If you are a hosted customer…

We will begin migrating hosted customers from the Search Banner component to the welcome banner feature on 20 November 2025. If you’re currently using this component, you’ll receive a message with the exact timing details for your plan tier.

This migration will copy over any site texts that you’ve updated for the theme component (i.e. search_banner.headline, search_banner.subhead, search_banner.search_button_text) and the values for the show on, plugin outlet, and background image theme component settings into the core feature settings.

Our goal is to minimize the visible impact of this move, so that the banner created by the core feature looks the same as the banner created by the theme component. Communities with an image on their banner may notice a slight shift in its positioning which can be addressed by cropping the image to center the content you want to appear in the banner.

After this migration, the theme component will be disabled and can be safely deleted from the Themes & components page (/admin/config/customize/components).

If you are a self-hosted user…

You should plan to migrate yourself from the theme component to the core feature by 15 December 2025. You can do this manually or using our provided script.

Manual migration

Here’s a map of how the Search Banner theme component’s site texts and settings relate to the same features for the core welcome banner:

Setting description Search Banner theme component Welcome Banner core feature
The heading text shown on the welcome banner. search_banner.headline site text js.welcome_banner.header.anonymous_members and js.welcome_banner.header.logged_in_members site texts
The subheading text shown on the welcome banner. search_banner.subhead site text js.welcome_banner.subheader.anonymous_members and js.welcome_banner.subheader.logged_in_members site texts
The text used for the search button on the banner. * search_banner.search_button_text site text js.welcome_banner.search_placeholder site text
Setting to determine which pages display the welcome banner. show on theme component setting Welcome banner page visibility site setting
Setting to determine where on the page the welcome banner appears. plugin outlet theme component setting Welcome banner location site setting
Background image used on the welcome banner. background image light theme component setting Welcome banner image site setting

* Note that the core welcome banner feature doesn’t support an explicit search button, so we recommend mapping this text to the customizable search field placeholder text for a similar result.

Script migration

Migration includes three separate rake tasks, which must be run in this order:

  1. Migrate component settings:
    themes:advanced_search_banner:migrate_settings_to_welcome_banner
  2. Migrate component translations:
    themes:advanced_search_banner:migrate_translations_to_welcome_banner
  3. Enable core banner, exclude component from themes where it is used, and disable component:
    themes:advanced_search_banner:exclude_and_disable

File .sh to be run in container:

#!/bin/bash

cd /var/www/discourse && rake themes:advanced_search_banner:<task_1_2_or_3>
4 个赞