mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 12:05:31 +08:00
9c5fc6f1df
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" ); } }); ``` |
||
---|---|---|
.. | ||
admin | ||
custom-proxy | ||
deprecation-silencer | ||
dialog-holder | ||
discourse | ||
discourse-common | ||
discourse-hbr | ||
discourse-i18n | ||
discourse-markdown-it | ||
discourse-plugins | ||
discourse-widget-hbs | ||
docs | ||
ember-addons | ||
ember-cli-progress-ci | ||
ember-production-deprecations | ||
float-kit | ||
locales | ||
pretty-text | ||
select-kit | ||
theme-transpiler | ||
truth-helpers | ||
.npmrc | ||
handlebars-shim.js | ||
polyfills.js | ||
service-worker.js.erb |