# ¿Cuál es la mejor manera de añadir un enlace al botón?

**URL:** https://meta.discourse.org/t/what-is-the-best-way-to-add-a-link-to-the-button/184465
**Category:** Development
**Created:** [25 Marzo, 2021 23:02 UTC](https://meta.discourse.org/t/what-is-the-best-way-to-add-a-link-to-the-button/184465 "2021-03-25T23:02:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![4ong](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/4ong/32/186618_2.png) [@4ong](https://meta.discourse.org/u/4ong)
#### Post date: [25 Marzo, 2021 23:02 UTC](https://meta.discourse.org/t/what-is-the-best-way-to-add-a-link-to-the-button/184465/1 "2021-03-25T23:02:22Z")

</div>

Estoy intentando reemplazar el botón “Nuevo tema” en una categoría específica para que dirija al cuestionario del Asistente (que creará el tema automáticamente).  
Código actual para renombrar el botón:

```html
<script type="text/discourse-plugin" version="0.8">
const i18nTopicLable = I18n.lookup("topic.create");
api.modifyClass("component:create-topic-button", {
  didInsertElement: function() {
    var button = $(this),
      category = button[0].parentView.get("category"),
      label = button[0].label,
      newTopicLabel = "topic.create",
      buttonText = "";

    if (category) {
      categoryName = category.name;

      if (label != newTopicLabel) {
        return;
      } else {
        switch (categoryName) {
          case "Category name": // nombre de la categoría
            buttonText = "Texto"; // texto del botón
            break;
          // agregar más arriba de esta línea
          default:
            buttonText = i18nTopicLable;
        }
        $("#create-topic .d-button-label").text(buttonText);
      }
    }
  }
});
</script>

```

¿Cuál sería la mejor manera de cambiar la acción para que enlace a otro lugar en lugar de abrir el editor de mensajes?  
¡Gracias!
