右侧边栏区块

: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: 必须启用用户目录,才能填充“顶级贡献者”列表。如果您的列表为空,请在管理员设置中搜索“启用用户目录”以确保其已启用。

  • 仅在使用 日历 插件时可用。
    ** 仅在使用 游戏化 插件时可用。

您还可以使用其他 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 热门主题的时间周期 每周 全部、每年、每季度、每月、每周、每天 top-topics
title 区块标题 各不相同 字符串 tag-topics, category-list, top-contributors
excludedGroupNames 排除指定群组 群组名称 top-contributors
order 贡献者排序 字符串(likes_received 或 likes_given) top-contributors
period 顶级贡献者的时间周期 每年 全部、每年、每季度、每月、每周、每天 top-contributors
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: 由我们托管? 主题组件可在我们的专业版、商业版和企业版计划中使用。

63 个赞
Discourse Gamification
Sidebar for Subcategories
Add User leaderboard in sidebar
FKB Pro - Social theme
Setup Continuous Integration using GitHub Actions
Blogroll (feature request)
Topic List Previews (TLP)
Discourse Bars :beers: :cocktail: (a sidebar framework)
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?
Adding a recent comments widget
Top Posters Widget?
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
Custom Components -- add button or text at any plugin outlet
Adding ‘hot topics’ to the Sidebar
FKB Pro - Social 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
Creating and installing plugins?
Discourse Gamification Plugin in the Header
Discourse Calendar updated to use fullcalendar 6
Customizing your site with existing theme components
I'm getting errors when I switch categories too quickly
目前我感觉看到的最好看的Discourse主题,有没有谁能爱心奉献一个
Creating and managing events
FKB Pro - Social theme
Displaying tags along with categories
Discourse Sidebar Blocks
Tag Icons + Tag Banners + Right Sidebar Blocks
Sidebar for Subcategories
Connectors not rendering
Creating a Top 20 leaderboard for a specific date range
How do you force keep open the sidebar?
Add social media handles on home page