mirror of
https://github.com/discourse/discourse.git
synced 2025-02-11 02:50:45 +08:00
![Sam](/assets/img/avatar_default.png)
This amends the extensibility on navigation bar so extra nav items are not added to a DIV nested into the UL, instead the LIs are rendered as usual
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
/**
|
|
A plugin outlet is an extension point for templates where other templates can
|
|
be inserted by plugins.
|
|
|
|
## Usage
|
|
|
|
If your handlebars template has:
|
|
|
|
```handlebars
|
|
{{plugin-outlet name="evil-trout"}}
|
|
```
|
|
|
|
Then any handlebars files you create in the `connectors/evil-trout` directory
|
|
will automatically be appended. For example:
|
|
|
|
plugins/hello/assets/javascripts/discourse/templates/connectors/evil-trout/hello.hbs
|
|
|
|
With the contents:
|
|
|
|
```handlebars
|
|
<b>Hello World</b>
|
|
```
|
|
|
|
Will insert <b>Hello World</b> at that point in the template.
|
|
|
|
## Disabling
|
|
|
|
If a plugin returns a disabled status, the outlets will not be wired up for it.
|
|
The list of disabled plugins is returned via the `Site` singleton.
|
|
|
|
**/
|
|
import { renderedConnectorsFor } from 'discourse/lib/plugin-connectors';
|
|
|
|
export default Ember.Component.extend({
|
|
tagName: 'span',
|
|
connectors: null,
|
|
|
|
init() {
|
|
this._super();
|
|
const name = this.get('name');
|
|
if (name) {
|
|
const args = this.get('args');
|
|
this.set('connectors', renderedConnectorsFor(name, args, this));
|
|
}
|
|
}
|
|
});
|