MediaWiki extensions manual
DynamicSidebar
Release status: stable
Implementation Skin , MyWiki
Description Provides dynamic sidebars based on user pages, groups, and categories.
Author(s) Ryan Lane (Ryan lanetalk)
Latest version 1.1 (2020-05-12)
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.29+
License GNU General Public License 2.0 or later
Download
Parameters
  • $wgDynamicSidebarUseUserpages
  • $wgDynamicSidebarUseCategories
  • $wgDynamicSidebarUsePageCategories
  • $wgDynamicSidebarUseGroups
Hooks used
  • SidebarBeforeOutput
Hooks provided
  • DynamicSidebarGetGroups
Quarterly downloads 136 (Ranked 69th)
Translate the DynamicSidebar extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

The DynamicSidebar extends the capabilities of the sidebar for logged in users. If allowed, users can add their own custom sidebars via the page "User:<username>/Sidebar". Administrators can add sidebars for groups, and userpage categories via the pages "MediaWiki:Sidebar/Group:<group>", and "MediaWiki:Sidebar/Category:<category>".

Installation

  • Download and place the file(s) in a directory called DynamicSidebar in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'DynamicSidebar' );
    
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

The following options are available:

// <translate nowrap><!--T:28--> Enable debugging</translate>
$wgDebugLogGroups['dynamic-sidebar'] = '/tmp/sidebar-debug.txt';

// <translate nowrap><!--T:29--> Allow users to create their own custom sidebars under <tvar name=1>User:<username>/Sidebar</tvar></translate>
// <translate nowrap><!--T:30--> Default:</translate> true
$wgDynamicSidebarUseUserpages = true;

// <translate nowrap><!--T:31--> Allow group sidebars under <tvar name=1>MediaWiki:Sidebar/Group:<group></tvar></translate>
// <translate nowrap><!--T:32--> Default:</translate> true
$wgDynamicSidebarUseGroups = true;

// <translate nowrap><!--T:33--> Allow user-category based sidebars under <tvar name=1>MediaWiki:Sidebar/Category:<category></tvar>.</translate> <translate nowrap><!--T:39--> (It will only show the sidebar if the category is set on the user page.)</translate>
// <translate nowrap><!--T:34--> Default:</translate> true
$wgDynamicSidebarUseCategories = true;

// <translate nowrap><!--T:35--> Allow category based sidebars under <tvar name=1>MediaWiki:Sidebar/Category:<category></tvar> (will only show the sidebar if the category is set on the page).</translate>
// <translate nowrap><!--T:36--> Default:</translate> false
$wgDynamicSidebarUsePageCategories = true;

Usage

Custom user sidebars

$wgDynamicSidebarUseUserpages must be enabled, then an administrator must add the following on the page "MediaWiki:Sidebar":

* USER-SIDEBAR

This string will be replaced with the user's sidebar.

Users should define their sidebar on the page "User:<username>/Sidebar".

Group sidebars

$wgDynamicSidebarUseGroups must be enabled, then an administrator must add the following on the page "MediaWiki:Sidebar":

* GROUP-SIDEBAR

This string will be replaced with the user's group sidebars.

Administrators must add a sidebar for each group on the page "MediaWiki:Sidebar/Group:<group>". If a user is in multiple groups, sidebars will be shown for each group. The group name listed here should be as expressed in LocalSettings.php, so "MediaWiki:Sidebar/Group:sysop", not "MediaWiki:Sidebar/Group:Administrator" or "MediaWiki:Sidebar/Group:Administrators".

Category sidebars

$wgDynamicSidebarUseCategories must be enabled to allow Users to add sidebars to pages based on the category set in their own user page.

$wgDynamicSidebarUsePageCategories must be enabled to allow Users to add sidebars to pages based on the category set in the page.

Then an administrator must add the following on the page "MediaWiki:Sidebar":

* CATEGORY-SIDEBAR

This string will be replaced with the sidebars of the categories on the user's userpage or the page itself.

Administrators must add a sidebar for each category at "MediaWiki:Sidebar/Category:<category>". If a user's userpage has multiple categories, sidebars will be shown for each category. Users can add sidebars by adding a category to their userpage or directly by adding a category in the page.

Possible issues

If the Dynamic sidebar doesn't appear or the menu is not collapsible then you need install the CollapsibleVector (link below):

  • Extension:CollapsibleVector

See also

This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.