بانر البحث المتقدم

:warning: Note

We are planning to deprecate support for this theme component soon and advise you to use the welcome banner feature instead.

:discourse2: Summary Advanced Search Banner puts a search bar along with optional headline and subhead text in a banner above the main topic list navigation.
:eyeglasses: Preview Preview on Discourse Theme Creator
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-search-banner
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Features

By default, this banner appears on all top-level topic pages (latest/new/unread/top/categories… anything in the top menu site setting) but it can also be set to only display on a community’s homepage.



Settings

Name Description
show on This determines which pages the banner appears
plugin outlet Where on the page the banner will appear
background image light Background image for the banner on light color palettes
background image dark Background image for the banner on dark color palettes
tile background image Repeat the background image
show for Who can see the Search Banner (logged in, logged out, or both)
special style Optional variations that change the appearance of the search banner
Translation Default
search_banner.headline Welcome to our community
search_banner.subhead We’re happy to have you here. If you need help, please search before you post.
search_banner.search_button_text

To omit one from display, leave the field blank.

Custom styling

The HTML element gets a class named .display-search-banner wherever this banner appears, and the banner itself is wrapped with the .custom-search-banner class, so with some CSS you should be able to customize the appearance of this banner however you see fit.

Future enhancements

  • Add an option to enable the banner in specific categories

Credits

:sparkling_heart: This very heavily borrows from @angusPavilion Header Search Theme Component


:discourse2: Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.

83 إعجابًا
[PAID] New search bar
Bringing popular features to Discourse: Header search, welcome banner, and category icons / emoji
Elementary Layout Component
Searching for users on mobile
New Theme: Tag-Pages Navigation
How to add links on home page menu to other site?
Adding Search option
Header search in custom header
Can't find how to localize a theme component
Mint Theme
Creating and installing plugins?
Bug with "search_banner.search_button_text" shown in search banner theme component
Search banner requires login
Pavilion Header Search Theme Component
Help Needed for Installing Meta Branded Theme
Banner Featured Links
Search section like on Reddit?
How do I edit "Welcome to our community" and tagline on the Homepage?
Anything wrong with this component?
User card out of alignment
Search Banner image cuts off on smaller screens
Pavilion Header Search Theme Component
Where to find search bar in our settings?
Where to find search bar in our settings?
Fully Theme
Welcome Banner components
What plug-in or customization for this header?
Custom Platform
Homepage header, how to add?
How can I make the home page similar to this one?
Theme or Custom CSS on Monday’s Discourse Instance?
Community not displaying correctly - new problem - help!
Christmas Decoration Component :christmas_tree:
We're upgrading our icons to Font Awesome 6!
Search for and/or filter topics in a category using text search
Forum search bar not showing up
Pavilion Header Search Theme Component
3.5.0.beta9: Improving color management, core welcome banner, and staff action log filters
Translations of theme component sample texts
Making my discourse site look a certain way
How can I change the HTML template of advanced search?
How to change the header text on the title page
Advanced Header Search
How to make a custom search bar?
Bug in Search banner theme component
Simple modifications
How can I achieve these header and footer customisations?
Meta Branded theme and all categories header
Search in this topic filter issue with Search banner TC
Bug with "search_banner.search_button_text" shown in search banner theme component
New Theme: Tag-Pages Navigation
Customizing your site with existing theme components

I’ve updated the theme component to add some new settings:

show on — this determines where the banner appears and has the options

  • top_menu (latest/categories/top/new/unread)
  • homepage
  • all (all pages except the default search page and admin pages)

show for — this determines who sees the banner

  • everyone
  • logged_in
  • logged_out
17 إعجابًا

لقد أجريت للتو تحديثًا بسيطًا يضيف نمطًا اختياريًا لهذا المكون، ويمنحك شريط بحث كبير بدون نص عنوان:

يمكن تمكين هذا عن طريق إعداد جديد “نمط خاص”. كل ما يفعله هذا هو تمكين بعض CSS الإضافية.


قد أضيف بعض الخيارات الأخرى هنا في المستقبل أيضًا!

8 إعجابات

كيف يمكنني تغيير لون نص الترحيب في هذه الإضافة؟

إعجاب واحد (1)

لا يوجد إعداد لذلك. ومع ذلك، يمكنك إضافته باستخدام بعض CSS:

أضف ما يلي إلى السمة الخاصة بك أو إلى مكون سمة جديد، وقم بالتغيير حسب رغبتك. :+1:

.search-banner > .custom-search-banner {
    /* title */
    h1 {
        color: #286989;
    }

    /* description */
    p {
        color: #286989
    }
}
3 إعجابات

شكراً جزيلاً!

إعجابَين (2)

هل هناك طريقة لإخفاء أيقونة البحث (باستخدام CSS أو غير ذلك)؟ أواجه مشكلة حيث تتكرر أيقونة البحث عند استخدامها مع هذا المكون: Advanced Header Search - #56 by RBoy

إعجاب واحد (1)
.search-input .search-icon:first-child {
  display: none;
}

يجب عرض أيقونة بحث واحدة فقط. ومع ذلك، فإن استخدام لافتة البحث والبحث في الرأس معًا له بعض الآثار الجانبية السيئة لتجربة المستخدم.

أوصي باستخدام أحدهما أو الآخر فقط.

4 إعجابات

شكرًا! مفيد جدًا

هل يمكنك توضيح ما هي الآثار الجانبية لتجربة المستخدم؟

إعجاب واحد (1)

يُظهر الفيديو الذي أشرت إليه أعلاه بعض المشكلات :slight_smile:

  • قوائم البحث المنسدلة المتداخلة
  • حالات فتح وإغلاق غريبة لقوائم البحث المنسدلة
  • أيقونة البحث هي رابط للبحث المتقدم في مربع إدخال بحث واحد وليست في الآخر
  • إلخ
إعجابَين (2)

حسناً. طالما أنهما ليسا معاً في نفس الصفحة، فلا ينبغي أن تكون هناك مشكلة.

إعجابَين (2)

هل يمكن لأحد مساعدتي؟ لقد قمت بتثبيت هذا القالب على منصة Discourse الخاصة بي ولكن الصورة مقطوعة من الجانب الأيمن، لكي تتناسب الصورة بالكامل يجب عليّ ضبط خط الموقع على “أصغر” لديّ تثبيتان مختلفان لـ Discourse وفي إحداهما عملت الصورة بشكل طبيعي، في الأخرى لماذا الصورة مقطوعة؟

إعجابَين (2)

هل يمكنك تضمين لقطة شاشة؟ سيؤدي ذلك إلى تسهيل فهم المشكلة بشكل كبير

إعجابَين (2)

لدي نفس المشكلة حيث تعرض المتصفحات/الأوضاع المختلفة أجزاء مختلفة من تلك الصورة. لقد قمت بحلها بجعلها عريضة جدًا، بحيث لا يظهر الجانب الأيمن إلا في بعض الظروف. لكن هذا ليس سهلاً جدًا للصور المتماثلة. أعتقد أن المزيد من CSS (دون البحث عن تجاوز لمكون thome) سيساعد في ذلك.

تمكنت من حل جزء منه، قمت بتعطيل مكون السمة في السمات الأخرى وتركته واحدًا فقط، ومن المدهش أنه يبدو أن الصورة كانت “طبيعية” بحجم الخط “طبيعي” فقط بسبب الهاتف الخلوي الذي يظهر فيه جانب واحد فقط من الصورة، هل هناك أي شيء يمكنني فعله لجعله يظهر بالكامل على هاتفي الخلوي أيضًا؟

مرحباً،

هل هناك طريقة لإزالة المسافة بين شريط البحث والرأس؟

إعجاب واحد (1)

مرحباً، يمكنك استخدام CSS هذا في مكون سمة جديد:

.custom-search-banner-wrap {
    margin-top: 0;
}
3 إعجابات

عمل بشكل مثالي، شكرا!

إعجابَين (2)

تم تقسيم 3 مشاركات إلى موضوع جديد: هل يمكنني إضافة فواصل أسطر إلى نص العنوان الفرعي لشعار البحث؟

يبدو أن Discourse لديه نفس المشكلة التي أواجهها في مجتمعي، يستغرق التراكب بعض الوقت لتغطية أي شيء تحت طبقة البحث (Discover):
2024-07-05 14.42.23

وهو أكثر وضوحًا في مجتمعي:
2024-07-05 14.49.53

أتساءل عما إذا كان أي شخص قد واجه حلاً لذلك، ربما تأخير في عرض التراكب؟ قد يؤدي ذلك إلى تجربة سيئة.

إعجاب واحد (1)