오늘의 Discourse 생일 및 기념일 (배너)

:information_source: 요약 오늘 생일과 결혼기념일을 표시하기 위해 사이트에 배너를 추가합니다.
:eyeglasses: 미리보기 Theme Creator
:hammer_and_wrench: 저장소 GitHub - NateDhaliwal/Discourse-Birthdays-Anniversaries-Today
:question: 설치 가이드 테마 또는 테마 컴포넌트 설치 방법
:open_book: 디스코urs 테마를 처음 사용하시나요? 디스코urs 테마 사용 입문 가이드

이 테마 컴포넌트 설치

:backhand_index_pointing_right: Cakeday 플러그인이 코어에 포함되었으므로, 이 테마 컴포넌트를 사용하려면 플러그인을 별도로 설치할 필요가 없습니다.

개요

이 테마 컴포넌트는 홈페이지 상단에 해당 날짜의 생일과 결혼기념일을 표시하는 배너를 배치합니다.

설정

banner_location 설정을 통해 배너를 배치할 위치를 선택할 수 있습니다. 사용 가능한 옵션은 다음과 같습니다:

  • above-site-header
  • below-site-header
  • above-main-containter

banner_text_colorbanner_background_color 설정은 각각 배너의 텍스트 색상과 배경색을 변경합니다. var(--primary) 또는 var(--tertiary)와 같은 디스코urs CSS 변수나 16진수(Hex) 값을 입력할 수 있습니다.

또한, anniversaries_textbirthdays_text 설정을 사용하면 각각 해당 이벤트를 축하하는 사용자 수를 나타내는 플레이스홀더 %{count}를 사용할 수 있습니다.

표시되는 사용자는 *핑(ping)*되지 않습니다: 사용자를 표시하기 위해 <a class="mention">를 사용합니다. 사용자를 클릭하면 각 사용자의 사용자 카드가 여전히 표시됩니다.

스크린샷:

데스크톱:


모바일:


추가 정보

사용자 표시를 위해 데이터는 /cakeday/anniversaries/today.json/cakeday/birthdays/today.json에서 가져옵니다.

이 아이디어는 디스코urs를 살펴보다 Cakeday 플러그인이 설치되어 있음에도 왜 다른 사용자의 생일과 결혼기념일을 축하하지 않는지 궁금해하면서 떠올랐습니다. 제가 belonged했던 포럼이나 Meta에서도 이런 식으로 하곤 했습니다. 이 테마 컴포넌트를 사용하면 사용자의 특별한 날을 함께 축하하며 더 포용적인 커뮤니티를 조성할 수 있습니다.

9개의 좋아요

You can now customize the background and text colours of the banner.

I may add an @if statement so that using the var() keyword isn’t necessary.

1개의 좋아요

Hi thanks for that. Is it possible to display no banner when there is no data instead of a message saying there is nothing to display?

3개의 좋아요

No problem, I was thinking of doing that anyway.

2개의 좋아요

This will be down for a while, while I fix this. I had to update a few getters to the correct names and debug them. Still working on it.
EDIT: It’s back up now. Let me do some final testing for the new setting.

2개의 좋아요

UPDATE: there are some issues with the setting controlling this. I suspect it’s because of the async fetch() I’m using. I’ll take a look again soon.

1개의 좋아요

Tagging this as broken for now as I fix this.

@patrickemin This is now ready! You can now use the setting hide_unused_data to hide either anniversaries or birthdays that are empty.
Sorry for the delay; I was overseas.

2개의 좋아요

Hi, there is a blue empty line above container as I have no data to display:

1개의 좋아요

Got it, I’ll work on a fix!

2개의 좋아요

이 문제를 해결하기 위해 다시 돌아왔습니다. 전체 구조를 단순화하기 위해 코드를 상당히 개선했습니다. 또한 해당 날짜에 기념일이나 생일이 없으면 자동으로 숨겨집니다. (TC와 설정 설명도 현지화했습니다)

새로운 설정 2가지가 추가되었습니다: anniversaries_textbirthdays_text. 해당 이벤트를 축하하는 사용자의 수를 표시하려면 %{count} 플레이스홀더를 사용할 수 있습니다.

오류나 문제가 발생하면 알려주세요!

‘기념일’과 ‘생일’을 얼마나 많이 작성했는지… :face_exhaling:

2개의 좋아요