Moin
June 13, 2025, 8:59pm
3
Where do you want to use it?
The Reddit-ish theme, for example, uses discourse/helpers/base-path
in the template to create the “the category list” link in the welcome message on the right.
tags: this.args.tag?.id,
});
}
<template>
{{#if this.isTopRoute}}
<div class="custom-right-sidebar_welcome">
<h2>{{i18n (themePrefix "top_route_welcome")}}</h2>
<p>
{{htmlSafe
(i18n (themePrefix "top_route_description") basePath=(basePath))
}}
</p>
{{#if (and this.currentUser this.currentUser.can_create_topic)}}
<DButton
class="btn-primary"
@id="custom-create-topic"
@action={{action "customCreateTopic"}}
@label="topic.create"
/>
{{/if}}
There are also examples where discourse/lib/get-url
is used to get the URL in a JavaScript function.
5 Likes