איך להוסיף כפתור חדש בתוך quick-access-profile?

Hello !

Is it possible to add a new link on this section :

It would be between “preference” and “notifications”. By either editing my theme or adding a new plugin.

Thank you !

Hello! Welcome back. :slight_smile:

You have an API function addQuickAccessProfileItem where it can insert an item before the logout button.

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

For example:

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

Then you can use CSS to reorder the items (that not ideal, but not much choice)

.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 }
}

Hope that helps. :+1:

9 לייקים

Thank you very much !

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