Customise 'Add Event' Button in Composer

AI-generated summary

A new Discourse admin, martyn_thomas, seeks help customizing the ‘Add Event’ button in the composer, noting that the button label ‘Add Date and Time’ disappeared in version 3.1 compared to 2.4. They identified the need to modify the button’s class and add a span for the label. Arkshine clarifies that the label is hidden due to two settings: the global events event label no text and a per-category setting, which were likely enabled. Disabling these settings restores the label, resolving the issue martyn_thomas confirms the fix worked, while Arkshine admits the solution required checking the code as the settings were not obvious.

Hi

New Discourse Admin here (been roped into doing a 2.4 to 3.* migration) - sorry in advance for the silly questions:

I’m trying to customise the date picker in the composer window.

In our 2.4 install it displays as ‘Add Date and Time’, but in 3.1 it’s just to calendar icon.

I’ve worked out that the button needs to following changed:

The button’s class to be changed from:

class="add-event btn no-text btn-icon"

to

class="add-event btn no-text btn-icon"

and a span to be added into the button

<span class="d-button-label">Add Date and Time<!----></span>

So it goes from

image

to

image

I cannot find any existing customisation (in Theme or Theme Components) which caused it in 2.4.

Can anyone advice the best way of making these changes in 3.1+?

Thanks

Hi,

You have two settings that remove the button label.

  • Global: events event label no text
    image

  • Per category:
    image

Make sure you did not enable one of those two options!

Worked a charm - thanks so much, it’s amazing how many settings are hidden unless you know what to look for,

Honestly, I had to look at the code; it was initially unclear to me. :smile: