quick-access-profileに新しいボタンを追加する方法

こんにちは!

このセクションに新しいリンクを追加することは可能ですか?

「preference」と「notifications」の間です。テーマを編集するか、新しいプラグインを追加することで可能です。

よろしくお願いします!

こんにちは!おかえりなさい。 :slight_smile:

ログアウトボタンの前にアイテムを挿入できる addQuickAccessProfileItem というAPI関数があります。

https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/plugin-api.gjs#L1893-L1907

例:

<script type="text/discourse-plugin" version="0.8">
api.addQuickAccessProfileItem({
  icon: "pencil-alt",
  href: "/somewhere",
  content: "Test"
})
</script>

次に、CSSを使用してアイテムを並べ替えることができます(理想的ではありませんが、他に選択肢はあまりありません)。

.user-menu {
    .summary { order: 1 }
    .activity { order: 2 }
    .invites { order: 3 }
    .drafts { order: 4 }
    .preferences { order: 5 }
    
    /* yours here */
    .test { order: 6 }
    
    .do-not-disturb { order: 7 }
    .logout { order: 8 }
}

お役に立てば幸いです。 :+1:

「いいね!」 9

どうもありがとうございます!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.