Page MenuHomePhabricator

[Spike] investigate how the left sidebar works (1 day)
Closed, ResolvedPublic

Description

Background:
We would like to learn how the left sidebar works so that we can easily / potentially add a link to the collaboration list.
The idea might be also to use the community configuration to let communities decide if they want it or not.

Acceptance criteria

  • a simple demo of adding something to the sidebar.

Event Timeline

VPuffetMichel renamed this task from [Spike] investigate how the left side bar works to [Spike] investigate how the left side bar works (1 day).Oct 22 2024, 1:20 PM

See also the "sidebar" interface message (example).

VPuffetMichel renamed this task from [Spike] investigate how the left side bar works (1 day) to [Spike] investigate how the left sidebar works (1 day).Oct 22 2024, 1:50 PM
VPuffetMichel updated the task description. (Show Details)

The left sidebar is populated by administrators using the /Mediawiki:Sidebar page, this contains a list of links in the format *page*|*link text* where *page* can be in the following formats:
Namespace:Pagename
I18n-key (for example 'portal-url' points to the localised version of Project:Community Portal)
Sections are delineated by indentation

This can be edited through two hooks - SidebarBeforeOutputHook and SkinBuildSidebarHook
Of these two, SkinBuildSidebarHook is recommended as SidebarBeforeOutputHook is not cached, although it seems SidebarBeforeOutputHook is more commonly used
They simply provide the array of links and allow them to be edited before rendering.

Given that this feature is limited to administrators only, it would be important to get buy in before rolling out this feature

Change #1084804 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] [DNM] POC adding sidebar links for CampaignEvents

https://gerrit.wikimedia.org/r/1084804

Of these two, SkinBuildSidebarHook is recommended as SidebarBeforeOutputHook is not cached, although it seems SidebarBeforeOutputHook is more commonly used

I guess it depends on what we'd like to do exactly. SkinBuildSidebar only varies cache by skin and language, so we couldn't use it for conditions such as "if the page is in the Event: namespace".

Given that this feature is limited to administrators only, it would be important to get buy in before rolling out this feature

Yup, I believe this is the key point. And it again depends on what we would like to implement. For example, adding a link to an existing section, and only for event pages, sounds way less controversial than say adding a new section that is shown on every page view. It's also quite nice to have a list of examples to see how this is being used by other extensions, as it may give us a better sense of what would be within common practice.

ifried subscribed.

I am closing this task because the investigation is complete and I have created a placeholder epic for the work, which can be found at T385349.

Thank you for this work, team!