右侧边栏区块

:discourse2: 摘要 右侧边栏模块 在主题列表右侧显示一个侧边栏,其中包含可配置的模块列表。
:eyeglasses: 预览 在 Discourse 主题创建器上预览
:hammer_and_wrench: 仓库链接 https://github.com/discourse/discourse-right-sidebar-blocks
:open_book: Discourse 主题新手? Discourse 主题使用新手指南

安装此主题组件

功能

该组件包含几个可在侧边栏中显示的模块:

  • popular-tags
  • top-contributors
  • recent-replies
  • category-topics
  • custom-html
  • category-list
  • subcategory-list
  • upcoming-events-list*
  • minimal-gamification-leaderboard**

:information_source: 必须启用用户目录,才能填充“顶级贡献者”列表。如果您的列表为空,请在管理员设置中搜索 enable user directory 以确保已启用。

* 仅在与 日历 插件配合使用时可用。
** 仅在与 游戏化 插件配合使用时可用。

您还可以将其他 Ember 组件用作模块,只需使用正确的名称即可。例如,核心包含一个 signup-cta Ember 组件,您可以直接在侧边栏中使用它。请注意,您不能使用需要一组参数的组件,但您 可以 在单独的主题中构建自己的 Ember 组件,并在侧边栏的 blocks 设置中仅通过其名称引用它。

您可以通过参数控制所提供模块的一些功能。

名称 描述 默认值 适用于
count 限制结果数量 因情况而异 数字 除 custom-html 外的所有模块
excerptLimit 限制每个回复摘要的长度 150 数字 recent-replies
id 分类 ID 分类 ID(category-list 使用逗号分隔) category-topics, category-list
content 要显示的内容 html custom-html
scopeToCategory 仅在分类或子分类 X 中显示 分类 ID popular-tags
excludedTags 排除的标签列表 标签名 popular-tags
displayInSpecificCategories 显示小部件的分类列表 全部 逗号分隔的数字 popular-tags
id 排行榜 ID 数字 minimal-gamification-leaderboard
tag 要显示的标签 标签名 tag-topics
period 热门主题的时间段 每周 all, yearly, quarterly, monthly, weekly, daily top-topics
title 模块标题 因情况而异 字符串 tag-topics, category-list, top-contributors
excludedGroupNames 排除指定的组 组名 top-contributors
order 对贡献者进行排序 字符串 (likes_received 或 likes_given) top-contributors
period 顶级贡献者的时间段 每年 all, yearly, quarterly, monthly, weekly, daily top-contributors
includeSubcategories 包含子分类事件 false false, true upcoming-events-list
upcomingDays 在提供值之前开始的事件 180 数字 upcoming-events-list
timeFormat 事件日期/时间格式 LT momentjs 格式 upcoming-events-list

设置

名称 描述
blocks
show in routes 仅限高级用户:将侧边栏限制在选定的路由上。
示例:discovery.latest, discovery.unread, discovery.new, discovery.top, tag.show, “c/category-slug”(用于分类), “tag/sample-tag”(用于标签)。
当为空时,侧边栏将在所有列表路由上显示。

blocks:选择要显示的模块并调整其顺序

show_in_routes:决定在哪些主题列表路由上显示侧边栏。默认情况下,它将在除 /categories 之外的所有发现路由上显示。

翻译 默认值
top_contributors.heading 顶级贡献者
top_contributors.view_all 查看全部
popular_tags.heading 热门标签
popular_tags.view_all 查看全部
recent_replies.heading 最近回复
subcategory_list.heading 子分类
top_topics.heading 热门主题
category_list.heading 分类

截图

请注意,该组件仅包含非常基本的样式,假设使用此组件的管理员将在自己的主题中添加自己的样式。

交互

当与 Discourse 日历 插件配合使用时,您可以为即将发生的事件添加一个侧边栏模块。模块名称为 upcoming-events-list,日期格式可以根据 此语法 进行自定义(例如,MMMM D, YYYY)。您还可以配置查看未来的时间范围,以及是否包含子分类事件(见上表)


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

64 个赞
Discourse Gamification
Sidebar for Subcategories
Add User leaderboard in sidebar
FKB Pro - Social theme
Setup Continuous Integration using GitHub Actions
Blogroll (feature request)
How to include a YouTube video or video widget on the community home page?
How to extend the Discourse sidebar?
Alternate presentation of sub-categories which puts the _top_ category first?
Discourse Bars :beers: :cocktail: (a sidebar framework)
FKB Pro - Social theme
Looking for the perfect theme
Discourse Bars :beers: :cocktail: (a sidebar framework)
Discourse Bars :beers: :cocktail: (a sidebar framework)
Add right sidebar gamification mini-leaderboard
Add right sidebar gamification mini-leaderboard
Pyx's Modern Theme
Homepage Blocks
Topic List Excerpts
🏷️ Bars Tag List Component
Discourse Bars :beers: :cocktail: (a sidebar framework)
When to switch themes/plugins to `.gjs`?
FKB Pro - Social theme
Recent replies takes 2 seconds to display
Leaderboard in homepage
Discourse Gamification Plugin in the Header
Discourse Calendar updated to use fullcalendar 6
I'm getting errors when I switch categories too quickly
目前我感觉看到的最好看的Discourse主题,有没有谁能爱心奉献一个
Discourse Sidebar Blocks
Tag Icons + Tag Banners + Right Sidebar Blocks
Adding ‘hot topics’ to the Sidebar
Hide admin user from user-directory and top contributors
Feedback wanted: userscript to theme component/plugin, or possible core sidebar browsing idea?
Have the upcoming-events block respect the subcategory filter when in Category lists
Topic List Previews (TLP)
Custom Components -- add button or text at any plugin outlet
Top Posters Widget?
Creating a Top 20 leaderboard for a specific date range
Connectors not rendering
Sidebar for Subcategories
Displaying tags along with categories
FKB Pro - Social theme
Creating and managing events
Customizing your site with existing theme components
Creating and installing plugins?
FKB Pro - Social theme
Adding a recent comments widget
How do you force keep open the sidebar?
Add social media handles on home page