类别横幅

:discourse2: 摘要 类别横幅 利用现有的类别详细信息为您的类别页面创建横幅(如需查看标签,请访问 Discourse 标签横幅)。
:eyeglasses: 预览 在 Discourse 主题创建器中预览
:hammer_and_wrench: 仓库链接 https://github.com/discourse/discourse-category-banners
:open_book: Discourse 主题新手? 使用 Discourse 主题的入门指南

安装此主题组件

功能

类别横幅 利用现有的类别详细信息为您的类别页面创建横幅。它使用类别名称、描述和颜色在相关类别页面的顶部生成横幅(如需查看标签,请访问 Discourse 标签横幅)。

类别描述由每个类别的“关于此类别的…主题”中的第一段定义。横幅背景/文本颜色由您的类别徽章设置定义。

默认情况下,这将在桌面端和移动端的各类别和子类别页面上显示,但如果您未为类别提供描述,则不会显示。

设置

此组件提供了一些选项以覆盖默认设置:

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

自定义说明

如果您想使用一些额外的 CSS 进行自定义,可以通过以下结构针对特定的类别标题(example-category 是您的类别名称):

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

此组件还会向 body 标签添加 category-header 类,作为额外的 CSS 目标。


:discourse2: 由我们托管? 主题组件可在我们的标准版、商业版和企业版计划中使用。

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?
Category boxes links
Plugins and theme components rarely support tag-pages
Discourse Category Headers theme component
Upcoming Events calendar -- how to embed in post?
New Theme: Tag-Pages Navigation
Tag Banners
Sending a message upon post
Header Submenus
Impact of component positioning with 2.5.0.beta6
Category Description
Capitalizing Tag names in Tag Banners
About Category Auto-Created Topic - Sitewide Options
Subcategories
Discourse as a Conference App (in person, virtual, or hybrid)
Show different ads on different categories
Unique CSS class for Group pages?
Adjusting layout of category pages
Category image not aligning as expected
Add forum description at top of home page
How do I add category banners?
Recommendations on layouts? A way to preview changes?
Category banner image slow to load
Use tag and category banner components together
Category page with fixed organization of topics
Customizing your site with existing theme components
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
Category, Group, Tag Descriptions as Topics
Uncaught (in promise) error
Category, Group, Tag Descriptions as Topics
Discourse Category Home :house:
Do you know what theme this is?
Traditional multi level hierarchy vs flat discourse hierarchy
How to add a "button" which composes a pre-filled topic
Category color selection should be allowed even when style is "none"
Show customisable message on private topics/categories?
Category description just after name
How to add this header, colored categories, and sidebar categories?
Receive the full description of a category in a theme
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?