====== SidebarNG Plugin ====== ---- plugin ---- description: Adds a flexible sidebar to your wiki author : Michael Klier email : chi@chimeric.de type : Action lastupdate : 2010-06-04 compatible : Lemming depends : conflicts : similar : sidebar tags : sidebar downloadurl: https://github.com/chimeric/dokuwiki-plugin-sidebarng/archive/master.zip bugtracker : https://github.com/chimeric/dokuwiki-plugin-sidebarng/issues sourcerepo : https://github.com/chimeric/dokuwiki-plugin-sidebarng ---- ===== Installation ===== Download the archive and unpack it into ''/lib/plugins''. * [[https://github.com/chimeric/dokuwiki-plugin-sidebarng/archive/master.zip|.zip]] Plugin Manager The plugin can also be installed via git. % cd /lib/plugins % git clone git://github.com/chimeric/dokuwiki-plugin-sidebarng.git sidebarng ==== New Development Version ==== Hello, I created a new repository with updates from arctic and dokubook template and some more config options. * https://github.com/samfisch/dokuwiki-plugin-sidebarng/tree/development * https://github.com/samfisch/dokuwiki-plugin-sidebarng/archive/development.zip {{http://r.notomorrow.de/dokuwiki-plugin-sidebarng/env-development/sidebarng/sidebarng-std.png?250}} {{http://r.notomorrow.de/dokuwiki-plugin-sidebarng/env-development/sidebarng/sidebarng-admin.png?250}} ===== 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) | ===== Sidebar Types ===== These are the different sidebar types. ^ Type ^ Description ^ | main | see [[#adding the main sidebar|main sidebar]] | | user | see [[#adding a user sidebar|user sidebar]] | | group | see [[#adding a group sidebar|group sidebar]] | | namespace | see [[#adding a namespace sidebar|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 ''/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 [[#adding custom sidebars|custom sidebar]] | ===== ACL Setup ===== If you like to use the user- or group-sidebars you have to set up your ''/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 [[.:sidebarng#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 ''/lib/plugins/sidebarng/sidebars/'' and putting a file called ''sidebar.php'' in there which holds your PHP code, i.e. ''/lib/plugins/sidebarng/sidebars//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 ''/lib/plugins/sidebarng/sidebars/example/sidebar.php''. ===== Bugs / Feature Requests ===== Please report bugs or feature requests at the [[https://github.com/chimeric/dokuwiki-plugin-sidebarng/issues|Bug tracker]]. ===== Further Resources ===== * [[https://github.com/chimeric/dokuwiki-plugin-sidebarng|Git Repository]] * [[https://github.com/chimeric/dokuwiki-plugin-sidebarng/issues|Bug Tracker]] ===== Changes ===== {{rss>https://github.com/chimeric/dokuwiki-plugin-sidebarng/commits/master.atom date}} ===== 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 [[https://github.com/chimeric/dokuwiki-plugin-sidebarng/issues|Bug Tracker]] instead. I visit this page not on a regular basis. --- //[[chi@chimeric.de|chi]] 2010/01/08 13:47// ---- I believe that a couple of screenshots will be useful here. [[mirari@mail.ru|mirari]] mirari, I'm a user who didn't make screenshots, but I do use this plugin [[http://wiki.dlma.com/doku.php?id=about|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.ballo_NOSPAM_@gmail.com|isma]] Finally, it works, not needing to add the namespaces' names !!! ---- Yes, there is a definite problem with the clear:both tag in sidebarng/style.css. Just remove it for "div.right_sidebar div.sidebar_box". At least when viewing in Chrome. ==== 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; } ==== Here is the code if you want to keep a fixed header, foot, sidebar and toc ==== div.dokuwiki div.stylehead { position:fixed; top:0; left:0; width:100%; height:90px; background-color:#FFFFFF; overflow:hidden; z-index:100; } div.dokuwiki div.stylefoot { position:fixed; bottom:0; left:0; width:100%; height:50px; background-color:#FFFFFF; overflow:hidden; } div.dokuwiki div.left_sidebar { position:fixed; top:100px; left:0; width:200px; height:100%; overflow:auto; padding:5px; border-right: 1px solid __border__; } div.dokuwiki div.page_right { height:100%; overflow:auto; margin:90px 5px 50px 200px; display:block; } div.dokuwiki div.sidebar_box ul { margin-left: 1.2em; } div.dokuwiki div.page_right div.toc { position: fixed; right: 5px; top: 60px; z-index:200; } .anchor { padding-top: 90px; } div.dokuwiki div.page_right div.toc a { padding-top: 0; } //this is to hide the small inc button div.footerinc { display:none; } //this is to hide the edit button in the sidebar div.dokuwiki div.left_sidebar form { display:none; } Note about the class .anchor. This is to fix the problem of named anchor under the header. So to make it work, you have to change the inc/parser/xhtml.php Before $this->doc .= '>'; After $this->doc .= '>';