Opening the login form with onclick in a theme component

I searched a lot before posting but couldn’t find it. I am changing this theme component a little and adding a new topic creation button. And I want non-login users to open the login area when they click the button. The file I’m trying to fix is the preclick part here: https://github.com/KilicSelcuk/discourse-new-image-ask-topic-button-theme-component/blob/main/common/header.html

I want to make the buttons visible instead of hiding them and encourage people to login or sign up to use this feature.

Thanks.

I did it this way.

helper.attach("button", {
      label: "log_in",
      className: "css_class_name",
      action: "showLogin",
      icon: "plus"
      })

Discourse’s customization code has changed a lot since 2018/2019. These resources might be very outdated.

Did you try having a look at how Discourse currently adds elements/buttons and attaches actions on them?

1 Like

Frankly, I don’t know where to find such documents. If there is a guide and you know it, if you share it, I will put you among the people I love :slight_smile: