Plantilla de respuesta

||||\n-|-|-|\n:discourse2: | Resumen | Reply Template (Plantilla de Respuesta) te permitirá reutilizar fácilmente parte de una publicación en una respuesta o un tema nuevo.\n| :eyeglasses: | Vista previa | Vista previa en Discourse Theme Creator\n:hammer_and_wrench: | Enlace al Repositorio | \u003chttps://github.com/discourse/discourse-reply-template-component\u003e\n:open_book: |¿Nuevo en los Temas de Discourse? | Guía para principiantes sobre el uso de Temas de Discourse\n\n[wrap=theme-install-button repoUrl="https://github.com/discourse/discourse-reply-template-component\" repoName="Discourse Reply Template"]\nInstalar este componente de tema\n[/wrap]\n[quote]\n\n:discourse2: Dado que este es un componente de tema official mantenido por el equipo de Discourse, las solicitudes de Support, Bug, UX y Feature se pueden realizar en las categorías respectivas aquí en Meta, y etiquetadas con la etiqueta de componente de tema apropiada. Haz clic en un enlace a continuación para iniciar una. :+1: \n\n\u003ckbd\u003e [:question:\u0026nbsp;Soporte](Discourse Meta "Solicitar soporte sobre la configuración y el uso de Plantilla de Respuesta") \u003c/kbd\u003e \u003ckbd\u003e [:bug:\u0026nbsp;Error](Discourse Meta "Un informe de error significa que algo está roto, lo que impide el uso normal/típico del componente de tema") \u003c/kbd\u003e \u003ckbd\u003e [:eyes:\u0026nbsp;UX](Discourse Meta "Discusión sobre la interfaz de usuario de Plantilla de Respuesta, y cómo se presentan las características (incluyendo idioma y elementos de la interfaz de usuario)") \u003c/kbd\u003e \u003ckbd\u003e [:bulb:\u0026nbsp;Característica](Discourse Meta "Discusión sobre cómo se pueden mejorar o mejorar las características existentes de Plantilla de Respuesta, y cómo podrían funcionar las características nuevas propuestas")\u003c/kbd\u003e\n\n[/quote]\n\n### Características\n\nReply Template (Plantilla de Respuesta) te permitirá reutilizar fácilmente parte de una publicación en una respuesta o un tema nuevo.\n\n### Uso\n\n\n[wrap=template key=\"nombre-plantilla\"]\nMi contenido reutilizable\n\n- [ ] tarea 1\n- [ ] tarea 2\n[/wrap]\n\n\nTen en cuenta que si un usuario no ha iniciado sesión, al hacer clic en el botón se mostrará la ventana modal de inicio de sesión.\n\nla clave es obligatoria\n\n### Otras opciones\n\n- action=\"create\" esto hará que el botón abra un compositor para crear un tema nuevo\n- action=\"create_pm\" esto hará que el botón abra un compositor para crear un mensaje privado nuevo\n- categoryId=\"2\" solo utilizable con action=\"create\", establecerá la categoría del compositor abierto\n- title=\"algún título\" solo utilizable con create y create_pm, título del tema/mensaje privado\n- recipients=\"a@example.com\" solo utilizable con create_pm, personas a las que se enviará\n- usernames=sam solo utilizable con create_pm\n- label=\"Texto de mi botón\" El texto del botón\n\n\n### Marcadores de posición (Placeholders)\n\nPuedes tener claves especiales en tu plantilla que serán reemplazadas:\n\n- \$week_start -\u003e fecha al comienzo de la semana\n- \$week_end -\u003e fecha al final de la semana\n- \$prev_week_start -\u003e fecha al comienzo de la semana anterior\n- \$prev_week_end -\u003e fecha al final de la semana anterior\n- \$today\n- \$tomorrow\n- \$username -\u003e nombre de usuario del usuario actual\n- \$name -\u003e nombre del usuario actual \n\nTen en cuenta que esto se reemplazará por fechas locales.\n\nLos marcadores de posición especiales también se interpolan en title\n\n### Lista de etiquetas (Tags list)\n\ntagsList=\":heart:,foo,#bar" mostrará una lista de casillas de verificación al final de la plantilla para que las personas puedan etiquetar su publicación fácilmente.\n\n

\n\n## Ejemplo\n\n\nMi lista de tareas pendientes $week_end\n\n- [x] tarea 1\n- [x] tarea 2\n\n\n### Configuración\n\n| Traducción | Predeterminado\n|-|-|\n| discourse_reply_template_component.use_template_reply | Usar plantilla como respuesta\n| discourse_reply_template_component.use_template_create | Usar plantilla como tema nuevo\n| discourse_reply_template_component.use_template_create_pm | Usar plantilla como MP nuevo\n| discourse_reply_template_component.needs_key | Cada plantilla necesita un atributo de clave. ej: [wrap=template key=\"estado_semanal\"][/wrap]\n\n\u003cbr\u003e\n\n\u003e:discourse2: ¿Alojado por nosotros? Los componentes de tema están disponibles para su uso en nuestros planes Estándar, Empresarial y Enterprise."

43 Me gusta

I was wondering can this be used in a specific category/sub?

Ie bug reporting form?

3 Me gusta

Yes :arrow_down:

E.g.
[wrap=template key="bug-report" action="create" categoryId="your-bug-category-id"]

9 Me gusta

Thank you will need to explore this more.

This is the best. Thank you!! I use this to create checklist templates that can be created anytime we’re doing a repetitive project. Before, our instructions would have been “copy and paste everything below” instead of having this very elegant button to create a topic for people.

5 Me gusta

Is there a plan to make this functionality accessible in the composer window? To me the most logical place being where things like Hide Details and Build Poll live.

3 Me gusta

I just updated the component, see OP for usage but a quick note:

  • placeholder dates are now replaced by local dates
  • you can now define a tagsList

8 Me gusta

Thank you for a great component!

It’s impossible to add a poll in the wrap. Can you add this functionality?

[wrap=template key="template-name"]

[poll type=regular results=on_vote chartType=bar]
# Who will join?
* 1
* 2
* 3
[/poll]

[/wrap]

I added more locales to your component and created a PR. Please, check.

1 me gusta

How can i install this component?

In my opinion it’d be more helpful to have an example for the reply case (without action=create) because this is probably the reason, the majority is searching for since creating a topic is already possible via URL

My try:

  • ok
  • fail
2 Me gusta

Would it be possible to use a template to create a new personal message?

Also, when someone is not signed in, clicking on “Use template as reply” does not result in any action. Could you add functionality where if a user is not logged in, something happens to nudge them to log in or create a new account?

4 Me gusta

Great suggestion, it’s done, I updated the OP.

4 Me gusta

Is there a way to pre-populate the title of a new topic?

Is there a way to automatically add tags instead of having just the tag list?

4 Me gusta

No, but that’s reasonable feature request for sure. I’m kinda full ATM but making a note of this, thanks.

5 Me gusta

Is there any possible way to modify the stock reply button in a topic with such a template?
That would be a gamechanger for specific structured conversations in the forum. Especially for contests etc where users have to submit content in a structured manner.

1 me gusta

Hi, sorry I don’t understand your request, can you be more specific please ?

Currently the user can access the reply template only via the button in the first post generated by the theme component.
What I would like to achieve is to enable the template for the stock reply buttons in the topic as well (reply button below the timeline and reply button below the last post)

Edit: One prolific use case is a topic where users can leave feedback like bug reports etc. If we could add per-topic post templates just like for per-category templates for new topics, that would lead to less incomplete reports and hence save our staff a lot of time.

5 Me gusta

Hola,

Tengo algunos problemas para instalar este componente. Soy nuevo en Discourse, así que espero que alguien pueda confirmar si los pasos que he seguido son correctos.

Seguí la guía aquí Installing a theme or theme component para instalar el componente. He incluido el componente en todos nuestros temas.

Sin embargo, cuando creo un nuevo tema e incluyo

Mi contenido reutilizable

  • tarea 1
  • tarea 2

No hay ningún botón para “Usar plantilla como respuesta”. Ejemplo:

Simplemente muestra el envoltorio alrededor de la plantilla. ¿Me falta algún paso? ¿Hay algo que necesite personalizar en el código?

Además, Discourse dice que el tema tiene errores en CSS, HTML o YAML. No estoy seguro de si eso tiene algo que ver con por qué no se muestra el botón.

Gracias por cualquier ayuda.

Echaré un vistazo mañana

2 Me gusta

Gracias. Me han informado que también podría ser un problema con la versión de Discourse que estamos ejecutando, pero volveré sobre eso.