Template di Risposta

||||\n-|-|-|\n:discourse2: | Riepilogo | Reply Template ti consentirà di riutilizzare facilmente parte di un post in una risposta o in un nuovo argomento.\n| :eyeglasses: | Anteprima | Anteprima su Discourse Theme Creator\n:hammer_and_wrench: | Link Repository | \u003chttps://github.com/discourse/discourse-reply-template-component\u003e\n:open_book: |Nuovo ai temi di Discourse? | Guida per principianti all’uso dei temi di Discourse\n\n[wrap=theme-install-button repoUrl="https://github.com/discourse/discourse-reply-template-component\" repoName="Discourse Reply Template"]\nInstalla questo componente tema\n[/wrap]\n[quote]\n\n:discourse2: Poiché si tratta di un componente tema #ufficiale mantenuto dal team di Discourse, le richieste di #supporto, Bug, UX e Feature possono essere effettuate nelle rispettive categorie qui su Meta, e taggate con il tag appropriato del componente tema. Clicca su un link qui sotto per iniziarne una. :+1: \n\n\u003ckbd\u003e [:question:\u0026nbsp;Supporto](Discourse Meta "Chiedi supporto sulla configurazione e l’uso di Reply Template") \u003c/kbd\u003e \u003ckbd\u003e [:bug:\u0026nbsp;Bug](Discourse Meta "Una segnalazione di bug significa che qualcosa non funziona, impedendo l’uso normale/tipico del componente tema") \u003c/kbd\u003e \u003ckbd\u003e [:eyes:\u0026nbsp;UX](Discourse Meta "Discussione sull’interfaccia utente di Reply Template, e su come vengono presentate le funzionalità (inclusi lingua ed elementi UI)") \u003c/kbd\u003e \u003ckbd\u003e [:bulb:\u0026nbsp;Funzionalità](Discourse Meta "Discussione su come le funzionalità esistenti di Reply Template possono essere migliorate o potenziate, e su come potrebbero funzionare le funzionalità proposte")\u003c/kbd\u003e\n\n[/quote]\n\n### Funzionalità\n\nReply Template ti consentirà di riutilizzare facilmente parte di un post in una risposta o in un nuovo argomento.\n\n### Utilizzo\n\n\n[wrap=template key=\"nome-template\"]\nIl mio contenuto riutilizzabile\n\n- [ ] attività 1\n- [ ] attività 2\n[/wrap]\n\n\nNota che se un utente non ha effettuato l’accesso, cliccando sul pulsante verrà visualizzata la finestra di login.\n\nla chiave è obbligatoria\n\n### Altre opzioni\n\n- action=\"create\" questo farà sì che il pulsante apra un compositore per creare un nuovo argomento\n- action=\"create_pm\" questo farà sì che il pulsante apra un compositore per creare un nuovo MP\n- categoryId=\"2\" utilizzabile solo con action=\"create\", imposterà la categoria del compositore aperto\n- title=\"un titolo\" utilizzabile solo con create e create_pm, titolo dell’argomento/MP\n- recipients=\"a@example.com\" utilizzabile solo con create_pm, persone a cui verrà inviato\n- usernames=sam utilizzabile solo con create_pm\n- label=\"Testo del mio pulsante\" Il testo del pulsante\n\n\n### Placeholder\n\nPuoi avere chiavi speciali nel tuo template che verranno sostituite:\n\n- \$week_start -\u003e data all’inizio della settimana\n- \$week_end -\u003e data alla fine della settimana\n- \$prev_week_start -\u003e data all’inizio della settimana precedente\n- \$prev_week_end -\u003e data alla fine della settimana precedente\n- \$today\n- \$tomorrow\n- \$username -\u003e nome utente dell’utente corrente\n- \$name -\u003e nome dell’utente corrente \n\nNota che queste verranno sostituite con date locali.\n\nI placeholder speciali sono anche interpolati in title\n\n### Elenco tag\n\ntagsList=\":heart:,foo,#bar" mostrerà un elenco di caselle di controllo alla fine del template in modo che le persone possano taggare facilmente il loro post.\n\n

\n\n## Esempio\n\n\nLa mia lista di cose da fare $week_end\n\n- [x] attività 1\n- [x] attività 2\n\n\n### Impostazioni\n\n| Traduzione | Predefinito\n|-|-|\n| discourse_reply_template_component.use_template_reply | Usa template come risposta\n| discourse_reply_template_component.use_template_create | Usa template come nuovo argomento\n| discourse_reply_template_component.use_template_create_pm | Usa template come nuovo MP\n| discourse_reply_template_component.needs_key | Ogni template necessita di un attributo chiave. es: [wrap=template key=\"weekly_status\"][/wrap]\n\n\u003cbr\u003e\n\n\u003e:discourse2: Ospitato da noi? I componenti tema sono disponibili per l’uso sui nostri piani Standard, Business ed Enterprise.

43 Mi Piace

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

Ie bug reporting form?

3 Mi Piace

Yes :arrow_down:

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

9 Mi Piace

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 Mi Piace

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 Mi Piace

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 Mi Piace

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 Mi Piace

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 Mi Piace

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 Mi Piace

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

4 Mi Piace

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 Mi Piace

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

5 Mi Piace

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 Mi Piace

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 Mi Piace

Ciao,

Sto avendo qualche problema nell’installazione di questo componente. Sono nuovo a Discourse, quindi spero che qualcuno possa confermare se i passaggi che ho intrapreso sono corretti.

Ho seguito la guida qui Installing a theme or theme component per installare il componente. Ho incluso il componente in tutti i nostri temi.

Tuttavia, quando creo un nuovo argomento e includo

Il mio contenuto riutilizzabile

  • attivitĂ  1
  • attivitĂ  2

Non c’è nessun pulsante per “Usa modello come risposta”. Esempio:

Mostra solo il wrapper attorno al modello. Mi manca qualche passaggio? C’è qualcosa che devo personalizzare nel codice?

Inoltre, Discourse dice che il tema ha errori nel CSS, HTML o YAML. Non sono sicuro se questo abbia a che fare con il motivo per cui il pulsante non viene visualizzato?

Grazie per qualsiasi aiuto.

Ci darò un’occhiata domani

2 Mi Piace

Grazie. Mi è stato comunicato che potrebbe anche essere un problema con la versione di Discourse che stiamo eseguendo, ma tornerò su questo punto.