分类横幅

:discourse2: 摘要 Category Banners 利用现有的分类详情为您的分类页面创建横幅(如需查看标签横幅,请参阅 Discourse Tag Banners)。
:eyeglasses: 预览 在 Discourse Theme Creator 上预览
:hammer_and_wrench: 仓库链接 https://github.com/discourse/discourse-category-banners
:open_book: 初识 Discourse 主题? 使用 Discourse 主题的初学者指南

安装此主题组件

功能

Category Banners 利用现有的分类详情为您的分类页面创建横幅。它使用分类名称、描述和颜色,在相关分类页面的顶部生成横幅(如需查看标签横幅,请参阅 Discourse Tag Banners)。

分类描述是在每个分类的 “Category definition for …” 主题中的第一段定义的。横幅背景/文本颜色由您的分类徽章设置定义。

默认情况下,这将在桌面和移动设备上显示在所有分类和子分类页面上,但如果您未为分类设置描述,则不会显示。

设置

此组件提供了一些覆盖默认值的选项:

名称 描述
show description 显示 “About This Category” 帖子中的描述
show mobile 在移动设备上显示横幅
show subcategory 为子分类显示横幅
hide if no description 如果未设置分类描述,则隐藏横幅
show category logo 显示分类徽标
align text
exceptions 这些分类名称不会显示横幅
categories 需要显示横幅的分类
plugin outlet 更改横幅在页面上的位置
show category icon 显示分类设置中的分类图标或表情符号 *
override category icon color 当使用分类图标时,启用此选项将使图标与横幅文本颜色匹配

* 请注意,此设置现在指的是 在分类设置中设置的分类图标或表情符号,而不是 Category Icons 主题组件(该组件已弃用,转而使用核心功能)。

自定义说明

如果您想通过一些额外的 CSS 来自定义这些内容,可以使用以下结构来定位特定的分类标题(example-category 是您的分类名称):

.category-title-header {
  &.category-banner-example-category {
        background: url(example.jpg);
  }
}

此组件还将 category-header 类添加到 body 标签,作为额外的 CSS 定位目标。


:discourse2: 由我们托管? 主题组件在我们的 Standard、Business 和 Enterprise 计划中均可使用。

101 个赞
Beginner's guide to using Discourse Themes
How difficult would it be to make the Discourse UI more like Flarum?
Banner on Discourse Forum
Unique CSS class for Group pages?
Discourse Category Headers theme component
Upcoming Events calendar -- how to embed in post?
Category boxes links
Plugins and theme components rarely support tag-pages
New Theme: Tag-Pages Navigation
Tag Banners
Sending a message upon post
Header Submenus
Category Description
Capitalizing Tag names in Tag Banners
Subcategories
Discourse as a Conference App (in person, virtual, or hybrid)
Show different ads on different categories
Category image not aligning as expected
How do I add category banners?
Category banner image slow to load
Use tag and category banner components together
How are these subcategories displayed on meta?
What is it that creates the big heading which is based on the "About the ... category" topic?
Discourse Doc Categories
Theme or Custom CSS on Monday’s Discourse Instance?
I need to install the Category Style plugin for my website
I want to know how to do this?
Add banner to categories
Help us test Horizon, our newest theme
Official groups/posts
Discourse Category Headers theme component
Creating a Unique Gallery Layout for a Category
Official groups/posts
Horizon Theme
New users can't sign up, 404 errors in console
Uncaught (in promise) error
Approximate Meta's design in my own forum
Unique CSS class for Group pages?
Adjusting layout of category pages
Receive the full description of a category in a theme
Category description just after name
Show customisable message on private topics/categories?
Category color selection should be allowed even when style is "none"
How to add a "button" which composes a pre-filled topic
Traditional multi level hierarchy vs flat discourse hierarchy
Do you know what theme this is?
Discourse Category Home :house:
Category, Group, Tag Descriptions as Topics
Category, Group, Tag Descriptions as Topics
Customizing your site with existing theme components
Category page with fixed organization of topics
Recommendations on layouts? A way to preview changes?
Add forum description at top of home page
About Category Auto-Created Topic - Sitewide Options
Impact of component positioning with 2.5.0.beta6
How to add this header, colored categories, and sidebar categories?
How can I create a category wide banner?
How to display a disclaimer to every topic in a category?
Update changed the "category logo" settings and now all the pictures are microscopic. revertable?