오른쪽 사이드바 블록

:discourse2: 요약 Right Sidebar Blocks는 주제 목록 오른쪽에 설정 가능한 블록 목록으로 구성된 사이드바를 표시합니다.
:eyeglasses: 미리보기 Discourse Theme Creator에서 미리보기
: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: Top Contributors 목록이 채워지려면 사용자 디렉터리가 활성화되어 있어야 합니다. 목록이 비어 있다면 관리자 설정에서 enable user directory를 검색하여 활성화되어 있는지 확인하세요.

* Calendar 플러그인과 함께 사용할 때만 사용할 수 있습니다.
** Gamification 플러그인과 함께 사용할 때만 사용할 수 있습니다.

사이드바 블록으로 다른 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 상위 주제 시간 기간 weekly 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 상위 기여자 시간 기간 yearly 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를 제외한 모든 탐색(discovery) 루트에 표시됩니다.

번역 기본값
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 Calendar 플러그인과 함께 사용할 경우, 다가오는 이벤트를 위한 사이드바 블록을 추가할 수 있습니다. 블록 이름은 upcoming-events-list이며, 날짜 형식은 이 구문을 따르도록 사용자 지정할 수 있습니다(예: MMMM D, YYYY). 미래까지 얼마나 멀리 볼지 및 하위 카테고리 이벤트가 포함되는지 여부도 설정할 수 있습니다(위 표 참조)


:discourse2: 우리가 호스팅하고 있나요? 테마 컴포넌트는 Pro, Business, Enterprise 플랜에서 사용 가능합니다.

65개의 좋아요
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 extend the Discourse sidebar?
How to include a YouTube video or video widget on the community home page?
Add social media handles on home page
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)
Creating a 'Blocks' API for injecting content
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
Topic List Previews (TLP)
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
A reddit-ish theme for Discourse
Cache the right hand sidebar contents
When to switch themes/plugins to `.gjs`?
Adding ‘hot topics’ to the Sidebar
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?

What should I add in the “name” parameter if I use custom-html?

1개의 좋아요

Great to see this as an official Theme Component! It certainly opens up a new world of customisations.

I’ve got 2 questions:

  1. In the sidebar, I want to display the /latest topic list similar to the way that category-topics displays them. Is this possible? recent-replies almost gets there (especially if the excerpt is hidden), but I really want to include topics without replies.

  2. Is it possible to only display the sideblocks in certain categories? What I mean is that the only route displayed is the Category Topic List, and only for the categories I specify.

1개의 좋아요

Apologies, the documentation for this is lacking (I will update it now). The name of the param for custom-html is content.

We don’t have anything ready-made for the full /latest list, but you build your own and add it to the configuration using its name. Should be very similar to the category/tag lists, just without a filter.

Currently, no, you can’t show it on specific categories only. You can however use discovery.category in the show in routes setting, that will only show the sidebar on category routes (but on all of them, not a subset).

3개의 좋아요

Thank you, is it possible to include the sidebar in each topic as well?

4개의 좋아요

Just noted a limitation of the component, especially when it comes the category-topics & subcategory-list blocks, and that is adding multiple blocks of either of these types with different id always resulted in them surfacing topics/subcategories of the uppermost block in the launch editor (I assume).

One bug I’m having right now is after playing around with the subcategory-list block for around 10-12 times, it stop showing altogether on our staging site (see video below).

2개의 좋아요

The subcategory-list block does not take a parameter at all. When used, it will show the subcategories of the current category based on which current category you have navigated to… so it doesn’t make sense to use that block more than once.

That is also why the subcategory-list isn’t showing in your video. If you’re on a non-category route, that block does not show.

For category-topics, in your video I see the same ID used twice: 7. I did a local test and with different IDs I get different topics displayed (i.e. I can’t reproduce the reported bug).

4개의 좋아요

Hi, a huge thank you for this awesome plugin!

I’ve got a question about the subcategory-list sidebar: is there an option to display it only for a particular category?

Our developers have had a look, and it seems there is no parameter id support for subcategory-list, is this something you could add, please?

2개의 좋아요

And regarding the top-contributors block: is there a way to fetch the results for a period of a week?

2개의 좋아요

Currently, no, this option does not exist. It makes sense to add it, although, I would imagine that it should support multiple IDs so you can show the block for a list of categories (A, B and C, for example). I am happy to review PRs on the repo, if your developers think they can add this, that would be great. (Otherwise, I can add it to a list of nice-to-haves in the theme component.)

Do you mean a) to fetch the results and cache them for a week or b) to fetch the top contributors for the last week on every load? The latter should be easy to add, caching is a little trickier.

3개의 좋아요

@pmusaraj can you add

padding: 3px 4px 3px 4px

for the popular-tags ?

Thanks.

1개의 좋아요

Hi @pmusaraj, thanks a lot for your reply!

Our developer has shared the PRs here, please have a look: Implement the `displayInCategories` parameter which allows to specify a list of categories where the `subcategories-list` block is displayed by d521bb85 · Pull Request #10 · discourse/discourse-right-sidebar-blocks · GitHub

The second variant would be perfect! We need to display the list of top contributors for the last week indeed. Thank you so much!

4개의 좋아요

The component intentionally has very little styling so that consumers can add their own styles in their own themes/theme components.

Thanks, that PR is great and it’s now merged!

I will also shortly work on adding configurability to the top contributors block (or if someone else is faster, happy to review a PR).

3개의 좋아요

I’m not sure where to find the code for that - would you mind directing me? I’d like to look at modifying the category-topics so that having no ID gives you all categories (and thus effectively the /latest list)

It would be great to have that in all the blocks!

2개의 좋아요

@pmusaraj Awesome! Thank you so much for your help, looking forward to using the top contributors block :slight_smile:

1개의 좋아요

Hi! I’m not sure if this component is causing errors. But once disabled, there are no more errors seen. :thinking: Could someone take a look at this to help me figure out the issue? Would appreciate it a lot.

With it enabled, visiting a certain topic on desktop, clicking the site logo in the top bar in the attempt to return to the homepage would bring me to a never-disappearing loading screen and throw errors in the browser console (as below). No related error logs seen in the mysite/logs path.

d6ca234baf8d2d5e65f414f31e198fe956d9a939.js?__ws=www.bfsu.cafe:98 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'findFiltered')
    at new CategoryTopics (d6ca234baf8d2d5e65f414f31e198fe956d9a939.js?__ws=www.bfsu.cafe:98:18)
    at h.createComponent (base-component-manager.js:37:1)
    at h.createComponent (ember-component-manager.js:54:1)
    at C.create (manager.js:558:1)
    at Object.evaluate (runtime.js:3301:1)
    at Object.evaluate (runtime.js:1312:1)
    at Dt.evaluateSyscall (runtime.js:5232:1)
    at Dt.evaluateInner (runtime.js:5188:1)
    at Dt.evaluateOuter (runtime.js:5180:1)
    at Wt.next (runtime.js:6191:1)
    at Wt._execute (runtime.js:6175:1)
    at Wt.execute (runtime.js:6166:1)
    at qt.handleException (runtime.js:5369:1)
    at Kt.handleException (runtime.js:5605:1)
    at Lt.throw (runtime.js:5302:1)
    at Be.evaluate (runtime.js:2580:1)
    at Lt._execute (runtime.js:5285:1)
    at Lt.execute (runtime.js:5266:1)
    at Ht.rerender (runtime.js:5634:1)
    at Er.render (index.js:7578:1)
    at index.js:7896:1
    at It (runtime.js:5074:1)
    at Rr._renderRoots (index.js:7876:1)
    at Rr._renderRootsTransaction (index.js:7928:1)
    at Rr._revalidate (index.js:7970:1)
    at invoke (backburner.js:351:1)
    at p.flush (backburner.js:241:1)
    at h.flush (backburner.js:447:1)
    at q._end (backburner.js:999:1)
    at _boundAutorunEnd (backburner.js:648:1)
CategoryTopics @ d6ca234baf8d2d5e65f414f31e198fe956d9a939.js?__ws=www.bfsu.cafe:98
createComponent @ base-component-manager.js:37
createComponent @ ember-component-manager.js:54
create @ manager.js:558
(匿名) @ runtime.js:3301
evaluate @ runtime.js:1312
evaluateSyscall @ runtime.js:5232
evaluateInner @ runtime.js:5188
evaluateOuter @ runtime.js:5180
next @ runtime.js:6191
_execute @ runtime.js:6175
execute @ runtime.js:6166
handleException @ runtime.js:5369
handleException @ runtime.js:5605
throw @ runtime.js:5302
evaluate @ runtime.js:2580
_execute @ runtime.js:5285
execute @ runtime.js:5266
rerender @ runtime.js:5634
render @ index.js:7578
(匿名) @ index.js:7896
It @ runtime.js:5074
_renderRoots @ index.js:7876
_renderRootsTransaction @ index.js:7928
_revalidate @ index.js:7970
invoke @ backburner.js:351
flush @ backburner.js:241
flush @ backburner.js:447
_end @ backburner.js:999
_boundAutorunEnd @ backburner.js:648
Promise.then(异步)
n @ backburner.js:28
flush @ index.js:46
_scheduleAutorun @ backburner.js:1218
_end @ backburner.js:1009
_boundAutorunEnd @ backburner.js:648
Promise.then(异步)
n @ backburner.js:28
flush @ index.js:46
_scheduleAutorun @ backburner.js:1218
_end @ backburner.js:1009
_boundAutorunEnd @ backburner.js:648
Promise.then(异步)
n @ backburner.js:28
flush @ index.js:46
_scheduleAutorun @ backburner.js:1218
_end @ backburner.js:1009
_boundAutorunEnd @ backburner.js:648
Promise.then(异步)
n @ backburner.js:28
flush @ index.js:46
_scheduleAutorun @ backburner.js:1218
_ensureInstance @ backburner.js:1206
scheduleOnce @ backburner.js:845
k @ index.js:522
queueRerender @ mount-widget.js:124
scheduleRerender @ widget.js:319
rerenderResult @ widget.js:365
F @ hooks.js:207
(匿名) @ hooks.js:247
dispatch @ jquery.js:5430
_.handle @ jquery.js:5234
frame:251 You dismissed the flag, but third party cookies are disabled on your browser so the flag will come back the next time you visit the page.

I see info about this component in the js file mentioned in the first line of the error log above.

// line 96-103 of d6ca234baf8d2d5e65f414f31e198fe956d9a939.js?__ws=www.bfsu.cafe
      const filter = "c/" + categoryId;
      this.category = _category.default.findById(categoryId);
      this.store.findFiltered("topicList", {
        filter
      }).then(result => {
        const results = result.topic_list.topics;
        results.forEach(topic => {
          topic.url = "".concat((0, _getUrl.default)("/t/")).concat(topic.slug, "/").concat(topic.id);
1개의 좋아요

Ah, yes, sorry about that. It should be fixed now, you just need to pull the latest update of the theme component.

3개의 좋아요

Thanks! Works great now.

3개의 좋아요

Hi @pmusaraj, sorry if I’m coming over as pushy - just wanted to know if there’s any ETA regarding this implementation.

It would be an awesome addition :slight_smile:

Thank you so much!

3개의 좋아요

Thank you for this awesome component!

I noticed that my entire header and footer disappears globally when I have this enabled (everything in my header.html and footer.html). Was this intentional? But to work around this I have to use the PluginAPI to manually add a header/footer.

2개의 좋아요