カスタム匿名モードボタンの追加

匿名ボタンの位置を画像のように移動させる方法を教えていただけますか?


ありがとうございます。

これは、プラグインアウトレットを使用して、いくつかのハンドルバーを追加することで実現できます(これらの概念については、Developing Discourse Themes & Theme Components を参照してください)。テーマ(管理 > カスタマイズ > テーマ > CSS/HTML の編集)では、このコードを <head> ファイルに追加できます。

<script type="text/x-handlebars" data-template-name="/connectors/above-main-container/anon-button">
{{#if this.currentUser}}
  {{#if this.currentUser.is_anonymous}}
    {{d-button class="btn-primary" action=(route-action 'toggleAnonymous') icon="ban" label="switch_from_anon"}}
  {{else}}
    {{d-button class="btn-primary" action=(route-action 'toggleAnonymous') icon="user-secret" label="switch_to_anon"}}
  {{/if}}
{{/if}}
</script>