discourse/docs
Jarek Radosz 9c5fc6f1df
DEV: Add more-topics plugin API (#29143)
From plugin-api comment:

Registers a new tab to be displayed in "more topics" area at the bottom of a topic page.

```gjs
 api.registerMoreTopicsTab({
   id: "other-topics",
   name: i18n("other_topics.tab"),
   component: <template>tbd</template>,
   condition: ({ topic }) => topic.otherTopics?.length > 0,
 });
```

You can additionally use more-topics-tabs value transformer to conditionally show/hide
specific tabs.

```js
api.registerValueTransformer("more-topics-tabs", ({ value, context }) => {
  if (context.user?.aFeatureFlag) {
    // Remove "suggested" from the topics page
    return value.filter(
      (tab) =>
        context.currentContext !== "topic" ||
        tab.id !== "suggested-topics"
    );
  }
});
```
2024-11-04 17:32:49 +01:00
..
ADMIN-QUICK-START-GUIDE.md FIX: Missing word 'done' (#29447) 2024-10-30 20:26:54 +11:00
AUTHORS.md
CHANGELOG-JAVASCRIPT-PLUGIN-API.md DEV: Add more-topics plugin API (#29143) 2024-11-04 17:32:49 +01:00
code-of-conduct.md
DEVELOPER-ADVANCED.md
DEVELOPMENT-OSX-NATIVE.md
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 update brevo free pricing (#28975) 2024-10-01 11:36:45 +08:00
INSTALL.md DEV: Update recommended Ruby to 3.2.1 (#20444) 2023-02-24 12:51:34 -03:00
PLUGINS.md
SECURITY.md FEATURE: Increase pbkdf2 iterations to 600k (#20981) 2023-04-11 11:56:20 +01:00
TESTING.md
TROUBLESHOOTING.md