Discourse Birthdays/Anniversaries Today (Banner)

:information_source: Summary Adds a banner to the site to show the anniversaries and birthdays today.
:eyeglasses: Preview Theme Creator
:hammer_and_wrench: Repository GitHub - NateDhaliwal/Discourse-Birthdays-Anniversaries-Today
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

:warning: The Cakeday plugin must be installed for this theme component to work.

This theme component places a banner at the top of the site on the homepage displaying the birthdays and anniversaries for that day.

The setting banner_location allows you to select where you want the banner to be placed. The available options are:

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

The settings banner_text_color an banner_background_color change the banner’s text and background colours respectively. You can input Discourse CSS variables like var(--primary) or var(--tertiary), or Hex values too.

I got this idea when looking at Discourse and wondering, since the Cakeday plugin is installed, why don’t users celebrate other user’s birthdays and anniversaries? We used to do this kind of thing on a forum I was on, and here on Meta too. With this theme component, you can celebrate user’s special days with them, promoting a more inclusive community.

Screenshots:
Desktop:

Mobile:


I grab the data from /cakeday/anniversaries/today.json and /cakeday/birthdays/today.json for the display of users.


I'm working towards a few settings to show only either anniversaries or birthdays.

:robot: I used a bit of AI to help get a few variables from a function to a function to a get(), and it rewrote it to an async function instead (I wrote the main logic for getting the data, so most of it wasn’t written by AI). JS isn’t my first language of choice, so I’m not very “into” it yet. Yet.

7 Likes

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 Like

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 Likes

No problem, I was thinking of doing that anyway.

2 Likes

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 Likes

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 Like

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 Likes

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

1 Like

Got it, I’ll work on a fix!

2 Likes