Category Banners uses existing category details to create banners for your category pages. It uses the category name, description, and color to generate a banner at the top of the relevant category pages (for tags check out Discourse Tag Banners).
The category description is defined by the first paragraph in each category’s “Category definition for …” topic. The banner background/text colors are defined by your category badge settings.
By default, this will display on desktop and mobile across all Category and Subcategory pages but will not appear if you haven’t given your category a description.
Settings
This component comes with options to override the defaults:
Name
Description
show description
Show description from “About This Category” post
show mobile
Show banners on mobile
show subcategory
Show banners for subcategories
hide if no description
Hide banners if category description is not set
show category logo
Show category logo
align text
exceptions
Banner will not show for these category NAMES
categories
Categories to show a banner for
plugin outlet
Changes the position of the banner on the page
show category icon
Show category icon or emoji from the category settings *
override category icon color
When the category icons are used, enabling this will make the icon match the banner text color
If you want to customize these with some additional CSS you can target specific category headers by using this structure (example-category is your category name):
thanks for this wonderful theme , it helps users to note the category description much easier.
currently if there’s a link or a bold/italic word in the category description, in the banner it’ll appear as simple text (e.x. p style instead of a style). isn’t it better if the text style is preserved in the banner as well?
Hi, I absolutely love this component! Thanks for your work!
I’m wondering, how can I style the background so that it automatically pulls the category background image and makes it the background of the banner. The backgrounds are already hidden anyways, so I want it to simply display as the background to the banner, rather than the page. I’ve tried this, but it didn’t work and I think I might be targeting the wrong variable:
카테고리 이름 앞에 접두사를 붙이지 않으면 재앙을 부를 수 있으므로, 클래스 이름 앞에 category-banner-를 추가했습니다(예: category-banner-meta). CSS에서 카테고리 이름을 대상으로 하고 있었다면, 해당 이름 앞에 category-banner-를 직접 추가해야 합니다.
확실하지는 않는데, 기본 카테고리 설명에서도 이모지를 지원하지 않는 것 같습니다. 다만 확인해 보겠습니다…
카테고리에 업로드된 배경 이미지를 배너의 배경으로 사용하고 싶습니다. 코드를 수정했는데 모든 것이 잘 보입니다. 이미지가 더 빠르게 로드되도록 하거나 페이지의 나머지 부분과 함께 로드되도록 할 수 있는 방법이 있을까요? 이미지가 나타내기 전에 배경이 1초간 깜빡이는 것을 피하고 싶습니다.
이미지 압축은 확실히 하나의 옵션이지만, 다른 방법도 있는지 궁금합니다. 코드로 업로드된 배경 이미지의 썸네일을 가져올 수 있을까요? 모든 조언에 감사합니다!
이 튜토리얼을 따라(정확히 동일한 단계를 수행했습니다) 이 카테고리 배너 컴포넌트를 설치해 보았지만, 아무 반응이 없습니다. 어떤 카테고리에도 배너가 표시되지 않습니다. 작동하지 않도록 만든 제가 한 실수가 있을까요? 제가 볼 수 있는 유일한 설명은 “bootstrap” 경고가 이를 차단하고 있다는 것입니다.
기본적으로, 카테고리에 설명을 설정하지 않은 경우 테마 구성 요소는 카테고리 배너를 표시하지 않습니다. “카테고리 설명이 설정되지 않으면 배너 숨김” 확인란의 선택을 해제하면 이를 변경할 수 있습니다.
카테고리 설명은 Discourse가 모든 카테고리에 대해 자동으로 생성하는 ‘카테고리 소개’ 토픽을 편집하여 설정합니다. 카테고리 설명을 추가했거나 설명이 없는 카테고리의 배너를 숨기는 설정을 비활성화했는데도 여전히 카테고리 배너가 표시되지 않는다면 알려주시기 바랍니다. 원인을 파악해 보겠습니다.
카테고리 배너 박스가 전체 너비로 상단에 표시되는 대신, 주요 제목 바로 위에 인라인으로 표시됩니다. 이를 통해 상단에 discourse-versatile-banner와 같은 배너 테마를 표시할 수 있습니다.
카테고리 배너 박스는 discourse의 핵심 구성 요소인 네이티브 discourse 하위 카테고리 박스와 동일한 스타일로 표시됩니다. 이러한 하위 카테고리 박스는 discourse 카테고리 설정의 Show subcategory list above topics in this category 옵션에서 표시할 수 있습니다. 이 옵션은 카테고리 목록 위를 표시하며, 카테고리 배경색을 왼쪽 테두리로 사용하여 하위 카테고리 이름과 설명을 행 또는 박스 형태로 표시합니다.
해당 카테고리가 하위 카테고리인 경우, 카테고리 이름은 다음과 같이 브레드크럼으로 표시됩니다 - 부모 카테고리 이름: 하위 카테고리 이름
이 적응판을 별도의 컴포넌트로 리팩터링했습니다. 헤더에서 카테고리 로고 이미지와 배경 이미지를 사용하는 등 많은 추가 기능이 포함되어 있습니다. 이 새로운 컴포넌트는 카테고리 배너와 달리 표준 Discourse 카테고리 헤더를 효과적으로 대체하므로, 새로운 컴포넌트입니다. 자세한 내용은 다음을 참조하세요: