# Abrir el formulario de inicio de sesión con onclick en un componente temático

**URL:** https://meta.discourse.org/t/opening-the-login-form-with-onclick-in-a-theme-component/275464
**Category:** Development
**Tags:** plugin-api
**Created:** [16 Agosto, 2023 21:01 UTC](https://meta.discourse.org/t/opening-the-login-form-with-onclick-in-a-theme-component/275464 "2023-08-16T21:01:23Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![kuaza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuaza/32/264151_2.png) [@kuaza](https://meta.discourse.org/u/kuaza)
#### Post date: [20 Agosto, 2023 18:39 UTC](https://meta.discourse.org/t/opening-the-login-form-with-onclick-in-a-theme-component/275464/2 "2023-08-20T18:39:45Z")

</div>

> [@Open the login popup Or trigger event when button is pressed](https://meta.discourse.org/t/open-the-login-popup-or-trigger-event-when-button-is-pressed/136385/4?u=kuaza):
>
> Thanks for sharing your code +1 If you want the login / sign up modals to show up directly, then you need to use the built-in showLogin and showCreateAccont actions. So instead of this helper.h( "button.btn-primary.btn", { type: "button" }, helper.h( "a", { href: "/signup" }, helper.h("span.d-button-label", "Tham Gia") ) ) you should use something like this for the signup modal helper.attach("button", { label: "sign\_up", className: "btn-primary btn-small sign-up-bu…

Lo hice de esta manera.

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

```

---

_[View the full topic](https://meta.discourse.org/t/opening-the-login-form-with-onclick-in-a-theme-component/275464)._
