I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Per-project sidebar content plugin

The Sidebar Content plugin adds user-defined content to the project sidebar. This content can be defined by project members having appropriate permissions (called “Manage sidebar”) and only for a particular project.

The plugin was written as an alternative to ezSidebar plugin. The last allows to define content for all pages and projects.

Using

By default the project sidebar content is disabled. To enable it go to Project → Settings → Sidebar tab and select one of the content types (to do this you must have “Manage sidebar” permission):

Content types

Content types

As seen on the screenshot the Sidebar content plugin supports three types of content:

Text

Textile (default) content. Textile is widely used1 in Redmine/ChiliProject:

Text(ile) content

Wiki page

The name of Wiki page:

Wiki page

The plugin will insert the content of the specified Wiki page into the sidebar.

HTML code

Raw HTML code:

HML code

Pages and URLs

After the content is defined you can shoose the location, where the content is to be shown.

Location

As seen on the screenshot the content can be shown on:
  • Project “Overview” page;
  • Issues pages (issues list and issue pages);
  • User-defined URLs.
The plugin uses hooks to add content to the sidebar. Unfortunately, at the moment there are a little of hooks, which can be used.

When user-defined URLs are selected you can optionally specify URL regular expression, which will be used to determine if the content should be shown for the URL. If the regular expression is not specified, the content will be shown for all project pages (for which the sidebar is shown) no matter whether “For URL” or “Not for URL” is selected.

Sample regular expressions

Check these samples of regular expressions:
  • ^/projects/redmine-sidebar(\?.*)?$ - show only on the “Overview” page
  • ^/issues/[0-9]+$ - show on issue pages
  • ^.+/wiki/.+$ - show on Wiki pages

Visibility configuration

Redmine has some pages, where you would like to put the content on the sidebar but which do not have the latter?.. Therefore, since 0.1.0 the plugin comes with the possibility to enable the sidebar for pages, which do not have it by default.

Global

New menu item in Administration

Adding the sidebar to pages is an important decision, therefore, this should be first configured in the Administration. The Sidebar Content plugin adds the new administration section “Sidebar”:

When clicked, this section opens the form:

Sidebar visibility configuration in Administration

This form lists project pages, which do not come with the sidebar be default (of course, this can be changed by another plugin). But selecting these pages here does not mean enabling the sidebar! In fact, what does selection mean is controlled by the “Per-project configuration policy”:

Visibility configuration policy

Let’s review each policy:

  • Global only
    Sidebar visibility configuration can be done only globally, i.e., in Administration → Sidebar and for all projects.
  • Can be disabled
    Only globally selected pages can be configured at the project level. The sidebar for these pages will be enabled by default.
  • Configurable if enabled globally (disabled by default)
    Global settings in Administration → Sidebar actually specify, sidebar visibility for which pages can be controlled at the project level. That is, by default, the sidebar won’t be enabled for any page selected globally and pages not selected globally won’t be configurable at the project level.
  • Per-project only
    Full control over the sidebar visibility is given to project managers.

Per-project

For all cases except “Global only” the sidebar visibility configuration is possible at the project level. In this case below the sidebar form you should see the “Sidebar visibility” link (see screenshots above). Clicking on this link opens the form:

Project sidebar visibility configuration

Some pages can be not selectable – this means that either “Can be disabled” or “Configurable if enabled globally” policy has been chosen.

Install

To install the plugin do:

  • For Redmine 2.0.x and above:
    • Copy sidebar directory to #{RAILS_ROOT}/plugins.
    • Run: rake redmine:plugins:migrate RAILS_ENV=production.
  • For ChiliProject and Redmine 1.4.x and below:
    • Copy sidebar directory to #{RAILS_ROOT}/vendor/plugins.
    • Run: rake db:migrate:plugins RAILS_ENV=production.
  • Restart Redmine/ChiliProject.
  • Grant “Manage sidebar” permission to appropriate roles.

1 this is the default type of all Redmine/ChiliProject pages, including Wiki

administration-sidebar.png View - New menu item in Administration (8.78 KB) Andriy Lesyuk, 10 Nov 2012 10:08

administration-visibility.png View - Sidebar visibility configuration in Administration (44.8 KB) Andriy Lesyuk, 10 Nov 2012 10:08

redmine-sidebar.png View - Content types (14.4 KB) Andriy Lesyuk, 10 Nov 2012 10:28

redmine-sidebar-text.png View - Text(ile) content (55.7 KB) Andriy Lesyuk, 10 Nov 2012 10:29

redmine-sidebar-wiki.png View - Wiki page (30.7 KB) Andriy Lesyuk, 10 Nov 2012 10:30

redmine-sidebar-html.png View - HML code (61.8 KB) Andriy Lesyuk, 10 Nov 2012 10:30

redmine-sidebar-location.png View - Location (18.8 KB) Andriy Lesyuk, 10 Nov 2012 10:30

sidebar-visibility.png View - Project sidebar visibility configuration (29.2 KB) Andriy Lesyuk, 10 Nov 2012 11:09

visibility-policies.png View - Visibility configuration policy (17.8 KB) Andriy Lesyuk, 11 Nov 2012 10:04

Terms of use | Privacy policy