Moin
13 Giugno 2025, 8:59pm
3
Dove vuoi usarlo?
Il tema simile a Reddit, ad esempio, utilizza discourse/helpers/base-path nel template per creare il link “l’elenco delle categorie” nel messaggio di benvenuto a destra.
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}}
Ci sono anche esempi in cui discourse/lib/get-url viene utilizzato per ottenere l’URL in una funzione JavaScript.
5 Mi Piace