# Sviluppo di plugin per Discourse - Parte 2 - Connettersi a un plugin outlet

**URL:** https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001
**Category:** Developer Guides
**Tags:** plugin-guides, tutorial
**Created:** [12 Luglio 2015, 5:48pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001 "2015-07-12T17:48:27Z")
**Posts on this page:** 19
**Page:** 2

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [15 Maggio 2018, 8:55am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/21 "2018-05-15T08:55:29Z")

</div>

> [@pfaffman](#):
>
> I think you can probably hide those with CSS.

Yes, and presumably you can apply to every available Theme so this can’t be switched off? (to address @sarahann concern about this approach).

---

<div class="post-metadata">

### Author: ![sarahann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sarahann/32/96703_2.png) [@sarahann](https://meta.discourse.org/u/sarahann)
#### Post date: [15 Maggio 2018, 5:33pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/22 "2018-05-15T17:33:44Z")

</div>

> [@sarahann](#):
>
> Using css `display: none;` isn’t an option.

I could use _display: none_ but it might now be as secure as we need it to be. And I figured it would be helpful to have a discussion on how to remove / change Discourse UI templates.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [23 Maggio 2018, 11:48am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/23 "2018-05-23T11:48:34Z")

</div>

It’s tricky to do properly, unfortunately. For a big customer of ours who needs functionality removed, my approach has been to hide the elements with CSS **and** remove the controller side actions by using `add_to_class` to overwrite the methods with an error in `plugin.rb`.

---

<div class="post-metadata">

### Author: ![sivert](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@sivert](https://meta.discourse.org/u/sivert)
#### Post date: [21 Novembre 2018, 6:20pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/25 "2018-11-21T18:20:14Z")

</div>

> [@sarahann](#):
>
> `/users-list-show.hbs`  
> `/users-list.hbs`
> 
> My changes never showed up. So I thought this plugin outlet topic could help

I have a same problem. I’m working on plugin with topic, and I have to change the html structures but it’s impossible with only CSS. So I was tried to overwrite template but changes never applied.  
So do you have find any solution for that?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [22 Novembre 2018, 2:35pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/26 "2018-11-22T14:35:52Z")

</div>

You can override any template in the application if you like (although outlets are always preferred!). How were you doing it? did you confirm the name is exactly the same as the template you are replacing?

---

<div class="post-metadata">

### Author: ![sivert](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@sivert](https://meta.discourse.org/u/sivert)
#### Post date: [23 Novembre 2018, 12:34am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/27 "2018-11-23T00:34:14Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/a/0/a05c2b877d7d4def84bb392653b78b83e398d348.png)  
I tried to override the “list/topic-list-item.raw.hbs” template, but even though I removed all of the content in template, the topic items still appearing as original, any changing in override template never worked.  
Please help me what I was wrong.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [23 Novembre 2018, 3:27am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/28 "2018-11-23T03:27:49Z")

</div>

See: [GitHub - discourse/discourse-simple-theme: Sam's simple discourse theme · GitHub](https://github.com/SamSaffron/discourse-simple-theme) for an example of how it is done.

---

<div class="post-metadata">

### Author: ![claudiawiese](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/claudiawiese/32/142975_2.png) [@claudiawiese](https://meta.discourse.org/u/claudiawiese)
#### Post date: [7 Giugno 2019, 8:55am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/29 "2019-06-07T08:55:39Z")

</div>

Hello,  
When I run the command git grep “plugin-outlet” – “\*.hbs” in my Linux Terminal, nothing shows up. Any ideas why? Thanks for your help!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [7 Giugno 2019, 9:12am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/30 "2019-06-07T09:12:48Z")

</div>

Caveat: This is a sysadmin answer, not a plugin developer answer, and I can’t guess what you might have done before you did your `git` command.

Did you add it to `git`? What about

```
 grep -r plugin-outlet .

```

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [7 Giugno 2019, 9:43am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/31 "2019-06-07T09:43:55Z")

</div>

Building on Jay’s shoulders here, you can of course focus on the specific file type:

`grep -r "plugin-outlet" --include \*.hbs`

---

<div class="post-metadata">

### Author: ![weallwegot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/weallwegot/32/124753_2.png) [@weallwegot](https://meta.discourse.org/u/weallwegot)
#### Post date: [7 Maggio 2020, 4:38am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/32 "2020-05-07T04:38:42Z")

</div>

> [@eviltrout](#):
>
> Ad esempio, se il tuo template Handlebars contiene:
> 
> ```plaintext
> {{plugin-outlet name="evil-trout"}}
> 
> ```

C’è qualcosa da considerare diversamente se il plugin outlet appare così?

```plaintext
{{plugin-outlet name="users-top" connectorTagName="div" args=(hash model=model)}}

```

Gli attributi `connectorTagName` e `args` significano che gli sviluppatori di plugin hanno vincoli particolari o accessi aggiuntivi quando utilizzano questi outlet?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [7 Maggio 2020, 2:19pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/33 "2020-05-07T14:19:50Z")

</div>

Sì, è previsto che tu lavori con l’API che gli outlet stabiliscono.

In `users-top` ti viene passato un `model` che puoi utilizzare, e il connettore verrà renderizzato con un `div` in questo caso.

---

<div class="post-metadata">

### Author: ![hocine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hocine/32/301751_2.png) [@hocine](https://meta.discourse.org/u/hocine)
#### Post date: [12 Aprile 2023, 4:57pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/35 "2023-04-12T16:57:03Z")

</div>

Non ho trovato {{plugin-outlet}}. Ho trovato alcuni componenti con lo stesso nome. Sono uguali?

![grafik](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/4X/e/b/2/eb20e4e3d4360cb1d526cb7811a460ff3ae7f2ec.png)

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [12 Aprile 2023, 7:27pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/36 "2023-04-12T19:27:30Z")

</div>

Penso che il codice di Discourse sia cambiato e che la guida potrebbe essere obsoleta.

Sto cercando questo esempio:

> [@eviltrout](#):
>
> Se sfogli i template handlebars di discourse, vedrai spesso il seguente markup:
> 
> ```plaintext
> {{plugin-outlet name="edit-topic"}}
> 
> ```

Ho trovato questo invece:

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/templates/topic.hbs#L80](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/templates/topic.hbs#L80)

E usando questo fantastico componente tema [(deprecated) Plugin outlet locations theme component](https://meta.discourse.org/t/plugin-outlet-locations-theme-component/100673) posso vedere questo outlet dove dovrebbe essere:

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/7/3/17372e025509d8b38846c169ddca733f8f54f2f2.jpeg)

Per rispondere alla tua domanda, la mia ipotesi è che sia lo stesso, ma con una nuova sintassi.

---

<div class="post-metadata">

### Author: ![hocine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hocine/32/301751_2.png) [@hocine](https://meta.discourse.org/u/hocine)
#### Post date: [12 Aprile 2023, 9:40pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/37 "2023-04-12T21:40:30Z")

</div>

Ho trovato anche questo tag. Qualcuno può confermare che siano tutti uguali?

```plaintext
{{~raw-plugin-outlet name="topic-list-after-title"}}

```

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [12 Aprile 2023, 9:46pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/38 "2023-04-12T21:46:19Z")

</div>

Il riferimento più aggiornato sulle prese plug-in è qui:

> [@Using Plugin Outlet Connectors from a Theme or Plugin](https://meta.discourse.org/t/using-plugin-outlet-connectors-from-a-theme-or-plugin/32727?u=david):
>
> Discourse includes hundreds of Plugin Outlets which can be used to inject new content or replace existing contend in the Discourse UI. ‘Outlet arguments’ are made available so that content can be customized based on the context. Choosing an outlet To find the name of a plugin outlet, search Discourse core for “\<PluginOutlet”, or use the [plugin outlet locations](https://meta.discourse.org/t/plugin-outlet-locations-theme-component/100673) theme component. (e.g. topic-above-posts). Wrapper outlets Some outlets in core look like \<PluginOutlet @name="foo" /\>. These allow you…

Cercherò di aggiornare l’OP qui nei prossimi giorni.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [13 Aprile 2023, 2:32pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/40 "2023-04-13T14:32:11Z")

</div>

OP aggiornato con la nuova sintassi e un link alla documentazione completa

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [23 Novembre 2025, 3:30am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/41 "2025-11-23T03:30:43Z")

</div>

> [@Discourse](#):
>
> ❗ Se vuoi vedere alcuni dei posti in cui esistono gli outlet dei plugin, puoi eseguire il seguente comando se sei su OSX o Linux:
> 
> ```plaintext
> git grep "<PluginOutlet" -- "*.hbs"
> 
> ```

Penso che il comando dovrebbe essere aggiornato in:

```plaintext
git grep "<PluginOutlet" -- "*.gjs"

```

> [@Discourse](#):
>
> @RGJ ha anche scritto [un componente tema](https://meta.discourse.org/t/plugin-outlet-locations-theme-component/100673) per mostrare le loro posizioni.

Quel link dice “deprecato”.

**Modifica:** Ho trovato il link per creare una PR sotto il post principale, quindi ho creato una PR.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [23 Novembre 2025, 9:35am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001/42 "2025-11-23T09:35:13Z")

</div>

> [@j127](#):
>
> Quel link dice “deprecato”.

Sostituito da:

[https://meta.discourse.org/t/introducing-discourse-developer-toolbar/346215?u=merefield](https://meta.discourse.org/t/introducing-discourse-developer-toolbar/346215?u=merefield)

[Pagina precedente](https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-outlet/31001.md?page=1)
