discourse/docs
Sérgio Saquetim 57ab42d4ca
FEATURE: Add automatic before and after outlets to wrapper plugin outlets (#24254)
Recently, Discourse introduced the concept of wrapper plugin outlets, which enables plugins and theme-components lo replace the wrapped content:

```
        <PluginOutlet @name="wrapper-outlet-example" @outletArgs={{hash model=@model}}>
          <div>Overridable content</div>
        </PluginOutlet>
```

This commit adds automatic outlets that are placed `before` and `after wrapper plugin outlets. Connectors them can leverage these new automatic outlets to mount content at these positions, which greatly enhances the use case of the wrapper outlets.

These new auto outlets can be used in two ways:

- Using the standard folder base structure: the folder name that identifies the outlet in which the connector must be mounted must add the suffixes `__before`or `__after` to the outlet name. For the outlet in the example above, the connector should be placed into the `.../connectors/wrapper-outlet-example__before`or `.../connectors/wrapper-outlet-example__after`folders.

- Using API calls: this commit also introduces two new plugin APIs, `api.renderBeforeWrapperOutlet` and `renderAfterWrapperOutlet`. These new APIs can be used in the same way as `api.renderInOutlet`but will only work for wrapper outlets.

  For the outlet above when using these new APIs alongside the gjs file format, one could define a component to be placed before the content of the outlet like:

  ```
  api.renderBeforeWrapperOutlet('wrapper-outlet-example', <template>Hello from before the content</template>);
  ```

  or after:

  ```
  api.renderAfterWrapperOutlet('wrapper-outlet-example', <template>Hello from after the content</template>);
  ```
2024-02-22 15:25:34 -03:00
..
ADMIN-QUICK-START-GUIDE.md DEV: Fix minor broken category link in ADMIN-QUICK-START-GUIDE.md (#25551) 2024-02-06 11:19:40 -05:00
AUTHORS.md HTTPSify links (#7046) 2019-02-22 16:29:27 +01:00
CHANGELOG-JAVASCRIPT-PLUGIN-API.md FEATURE: Add automatic before and after outlets to wrapper plugin outlets (#24254) 2024-02-22 15:25:34 -03:00
code-of-conduct.md Update Code of Conduct to v2.0 (#12296) 2021-03-04 23:44:58 -05:00
DEVELOPER-ADVANCED.md Update DEVELOPER-ADVANCED.md (#15770) 2022-02-02 11:05:37 -05:00
DEVELOPMENT-OSX-NATIVE.md DEV: Swap out optipng with oxipng (#15013) 2021-11-22 10:16:35 -07:00
INSTALL-cloud.md Update INSTALL-cloud.md screenshots and copy when landed on the forum homepage (#25671) 2024-02-14 07:31:44 -07:00
INSTALL-email.md DOCS: Update INSTALL-email to point to Brevo correctly 2023-12-04 11:46:33 +11:00
INSTALL.md DEV: Update recommended Ruby to 3.2.1 (#20444) 2023-02-24 12:51:34 -03:00
PLUGINS.md discourse/discourse change from 'master' to 'main' 2021-07-19 11:46:15 -04:00
SECURITY.md FEATURE: Increase pbkdf2 iterations to 600k (#20981) 2023-04-11 11:56:20 +01:00
TESTING.md DEV: replace mailcatcher references with mailhog (#14500) 2021-10-05 15:48:06 +05:30
TROUBLESHOOTING.md for docs, normalize on space after code fence when specifying lang 2019-01-21 01:19:28 -08:00