A plugin outlet on top of the sidebar

AI-generated summary

The discussion revolves around adding a plugin outlet at the top of the sidebar in Discourse. manuel initially requested it to support custom layouts like brand logos or search bars. awesomerobot initially opposed, preferring API-based customization for future compatibility, and even suggested removing the existing footer outlet. However, after internal review, awesomerobot announced the addition of two new outlets: before-sidebar-section and after-sidebar-sections, acknowledging that outlets are currently unavoidable. The team still recommends using the API for navigation-related customizations to ensure future-proofing. merefield supported the request, noting its usefulness in dropdown menu mode, and thanked the team for addressing it merefield. Andrew_Rowe confirmed the new outlet enables top-level menu creation and plans to test it via the outlets dev tool. The feature is now tagged as completed.

There is a plugin outlet to add items to the sidebar footer. It would be great to have an outlet to add items to the top as well.

For example this is a common sidebar layout that could work well for some Discourse communities (showing a brand logo and background element right on the sidebar, as well as a search bar):

6 Likes

We don’t plan on adding additional outlets to the sidebar at the moment. We’re likely going to remove the footer outlet at some point as well.

The new sidebar nav was intentionally designed to be customized via the API so in the event that it changes in the future, we can more easily migrate to a new structure. The idea being that the navigation area isn’t something we want any random content injected into.

This isn’t to say the sidebar shouldn’t be customizable, but we want to expose more specific APIs rather than rely on open-ended plugin outlets.

7 Likes

Actually, I second this.

It would be useful to have one as you could use it when using Dropdown mode for the menu at which point the Sidebar div is pointless, so let us use it for something!

Moreover, it would be nice to have two, one on each side, each with its own!

3 Likes

Last week we discussed this some more internally and ended up where the consensus was that there’s no way around adding outlets at the moment — so now we have:

before-sidebar-section and after-sidebar-sections available as outlets

If the need is to add a custom section of links that mirrors the layout of existing link sections, the recommendation is to still use the API so we can maintain compatibility if the sidebar changes in the future. If this part of Discourse were to change again (no current plans) we can’t promise that the plugin outlets would neatly be migrated over like we can with an API.

9 Likes

thanks for putting that on the agenda.

meantime, I’ll see if I can find some other workaround

2 Likes

So there is an outlet before the existing sidebar so conceivably a developer could create a top level menu on top of the standard left sidebar menu. I guess I could check in outlets dev tool

Closing as completed - please start new topics for any questions about this feature.