DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:sidebarng

This is an old revision of the document!


sidebarng plugin

Compatible with DokuWiki

2009-12-25, 2009-02-14

plugin Adds a flexible sidebar to your Wiki

Last updated on
2010-06-04
Provides
Action
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to sidebar

Tagged with sidebar

Installation

Download the archive and unpack it into <dokuwiki>/lib/plugins.

  • .tgz Plugin Manager

The plugin can also be installed via git.

% cd <dokuwiki>/lib/plugins
% git clone git://github.com/chimeric/dokuwiki-plugin-sidebarng.git sidebarng

Configuration

The plugin can be configured using DokuWiki's configuration manager available in the admin menu.

pos sidebar position
pagename wiki pagename to use for sidebars (default “sidebar”)
group_ns Namespace for group sidebars (default “group”)
user_ns Namespace for user sidebars (default “user”)
content Sidebar content
order Sidebar order (comma separated)
main_always Always show main sidebar (default yes)

These are the different sidebar types.

Type Description
main see main sidebar
user see user sidebar
group see group sidebar
namespace see namespace sidebar
trace shows the trace
toolbox shows the set of “action links” (login, edit, index, etc.) inside the sidebar, instead of their default location in horizontal toolbars above and below the page
extra You can put a file inside <dokuwiki>/lib/plugins/sidebarng/ called sidebar.html which will be included if you select the extra type. This comes in handy for example if you like to include Google ads.
custom see custom sidebar

ACL Setup

If you like to use the user- or group-sidebars you have to set up your <dokuwiki>/conf/acl.auth.php the right way.

This is an example setup for a user “tom” (User-Name: tom) who is a member of group “@user”. The “user sidebar namespace” is set to “user” and “group sidebar namespace” is set to “group”. We will grant him write/page-creation/upload permissions for his own namespace and read/edit permissions for the group:users namespace to everyone who's part of the group “@users”.

---- snip ----
user:*           @ALL   0
group:*          @ALL   0
user:tom:*       tom    8
group:users:*    @user  2
---- snap ----

First Steps

Adding the Main Sidebar

First of all, you would probably like to create the main sidebar, i.e. the sidebar associated with the root namespace. You simply have to create a wikipage called sidebar—or whatever you set pagename to— and add some links.

====== Navigation  ======
[[wiki:playground]]\\
[[wiki:syntax]]\\
[[some:more:links]]\\

TIP: It is possible to create this page right in the wiki. Go to any page of your wiki and change the query string of the URL (in your browser's address bar) to '?id=sidebar'; then just create this page.

Adding a User Sidebar

If you've enabled user sidebars you can add a sidebar for each registered user. All you have to do is create a wikipage user:username:sidebar. Note, this feature depends on a proper acl-setup. If you use @USER@ inside this sidebar it will get substituted with the user name of the logged in user.

Adding a Group Sidebar

Group sidebars are set up just like user sidebars. For example, to create a sidebar visible only to those in the admin group, you would create one named group:admin:sidebar. If you use @GROUP@ inside such a sidebar it will get substituted with the group name of the sidebar.

Adding a Namespace Sidebar

If you've enabled namespace sidebars you can add a sidebar for every namespace you like. Thus the naming scheme is the same for all sidebars, the only thing you've to do is create a page called, you guessed right ;-), “sidebar” inside the desired namespace. This sidebar, then, will only show if you browse pages within this namespace.

Adding custom sidebars

The plugin also supports custom sidebars. You can create your own custom sidebar by creating a new subdirectory inside <dokuwiki>/lib/plugins/sidebarng/sidebars/ and putting a file called sidebar.php in there which holds your PHP code, i.e. <dokuwiki>/lib/plugins/sidebarng/sidebars/<sidebar name>/sidebar.php. Then you can activate the sidebar by adding its name to the comma separated list of other sidebars in the sidebarng settings. For an example have a look at <dokuwiki>/lib/plugins/sidebarng/sidebars/example/sidebar.php.

Bugs / Feature Requests

Please report bugs or feature requests at the Bug tracker.

Further Resources

Changes

FAQ

It doesn't seem to work, the sidebars appear at the wrong place, what can I do?

That's most probably a caching issue - try CTRL+SHIFT+R in Firefox.

Change text alignment

Change the style.css in the plugin-folder. You'll need to empty the caches, otherwise the change will not show immediately.

Discussion

NOTE: Don't post patches, bug reports or feature requests here. Use the Bug Tracker instead. I visit this page not on a regular basis. — chi 2010/01/08 13:47


I believe that a couple of screenshots will be useful here. mirari


I use this plugin in conjunction with nstoc. It works for the mainpage but not for having different tocs according to namespaces. isma Finally, it works, not needing to add the namespaces' names !!!

Non-Printing Sidebar

I didn't want the sidebar content showing up when users printed the page. To accomplish that, I added a print.css stylesheet to the dokuwiki\lib\plugins\sidebarng folder. Here is it's content:

div.dokuwiki div.left_sidebar {
    display: none;
}
 
div.dokuwiki div.right_sidebar  {
    display: none;
}
plugin/sidebarng.1297784838.txt.gz · Last modified: 2011-02-15 16:47 by 145.242.11.3

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki