Compatible with DokuWiki
2009-12-25, 2009-02-14
Similar to sidebar
Download the archive and unpack it into <dokuwiki>/lib/plugins.
The plugin can also be installed via git.
% cd <dokuwiki>/lib/plugins % git clone git://github.com/chimeric/dokuwiki-plugin-sidebarng.git sidebarng
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 |
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 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.
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.
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.
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.
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.
Please report bugs or feature requests at the Bug tracker.
That's most probably a caching issue - try CTRL+SHIFT+R in Firefox.
Change the style.css in the plugin-folder. You'll need to empty the caches, otherwise the change will not show immediately.
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
mirari, I'm a user who didn't make screenshots, but I do use this plugin here. I made some minor changes, like removing some CSS clear directive that'd prevent the main page from aligning to the right of the sidebar.
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 !!!
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; }