DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:sidebarng

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:sidebarng [2010-06-02 00:13] 71.198.156.157plugin:sidebarng [2023-10-30 23:43] (current) Klap-in
Line 1: Line 1:
-====== sidebarng plugin ======+====== SidebarNG Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: Adds a flexible sidebar to your Wiki+description: Adds a flexible sidebar to your wiki
 author     : Michael Klier author     : Michael Klier
 email      : chi@chimeric.de email      : chi@chimeric.de
 type       : Action type       : Action
-lastupdate : 2010-05-31 +lastupdate : 2010-06-04 
-compatible : 2009-12-25, 2009-02-14+compatible : Lemming
 depends    :  depends    : 
 conflicts  conflicts 
Line 13: Line 13:
 tags       : sidebar tags       : sidebar
  
-downloadurl: http://cloud.github.com/downloads/chimeric/dokuwiki-plugin-sidebarng/plugin-sidebarng.tgz +downloadurl: https://github.com/chimeric/dokuwiki-plugin-sidebarng/archive/master.zip 
-bugtracker : http://github.com/chimeric/dokuwiki-plugin-sidebarng/issues +bugtracker : https://github.com/chimeric/dokuwiki-plugin-sidebarng/issues 
-sourcerepo : http://github.com/chimeric/dokuwiki-plugin-sidebarng+sourcerepo : https://github.com/chimeric/dokuwiki-plugin-sidebarng
-donationurl: https://www.paypal.com/xclick/business=chi%40chimeric.de&item_name=DokuWiki%2BPlugin%2BDonation&no_shipping=1&no_note=1&tax=0&currency_code=EUR&lc=US+
 ---- ----
  
-===== Donate ===== 
-Support the ongoing development of DokuWiki Plugins and Templates and [[https://www.paypal.com/xclick/business=chi%40chimeric.de&item_name=DokuWiki%2BPlugin%2BDonation&no_shipping=1&no_note=1&tax=0&currency_code=EUR&lc=US|buy me a coffee]] ;-) (Suggested: 3€ for a regular or 5€ for big latte with caramel). 
 ===== Installation ===== ===== Installation =====
 +
 Download the archive and unpack it into ''<dokuwiki>/lib/plugins''. Download the archive and unpack it into ''<dokuwiki>/lib/plugins''.
  
-  * [[http://cloud.github.com/downloads/chimeric/dokuwiki-plugin-sidebarng/plugin-sidebarng.tgz|.tgz]] Plugin Manager+  * [[https://github.com/chimeric/dokuwiki-plugin-sidebarng/archive/master.zip|.zip]] Plugin Manager
  
 The plugin can also be installed via git. The plugin can also be installed via git.
Line 32: Line 30:
 % git clone git://github.com/chimeric/dokuwiki-plugin-sidebarng.git sidebarng % git clone git://github.com/chimeric/dokuwiki-plugin-sidebarng.git sidebarng
 </code> </code>
 +
 +==== 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 ===== ===== Configuration =====
 +
 The plugin can be configured using DokuWiki's configuration manager available in the admin menu. The plugin can be configured using DokuWiki's configuration manager available in the admin menu.
  
Line 45: Line 55:
  
 ===== Sidebar Types ===== ===== Sidebar Types =====
 +
 These are the different sidebar types. These are the different sidebar types.
  
 ^ Type ^ Description ^ ^ Type ^ Description ^
-| main | see [[.:sidebarng#adding the main sidebar|main sidebar]] | +| main | see [[#adding the main sidebar|main sidebar]] | 
-| user | see [[.:sidebarng#adding a user sidebar|user sidebar]] | +| user | see [[#adding a user sidebar|user sidebar]] | 
-| group | see [[.:sidebarng#adding a group sidebar|group sidebar]] | +| group | see [[#adding a group sidebar|group sidebar]] | 
-| namespace | see [[.:sidebarng#adding a namespace sidebar|namespace sidebar]] |+| namespace | see [[#adding a namespace sidebar|namespace sidebar]] |
 | trace | shows the trace | | 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  | | 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. | | 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 [[.:sidebarng#adding custom sidebars|custom sidebar]] |+| custom | see [[#adding custom sidebars|custom sidebar]] |
  
 ===== ACL Setup ===== ===== 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. If you like to use the user- or group-sidebars you have to set up your ''<dokuwiki>/conf/acl.auth.php'' the right way.
  
Line 72: Line 84:
  
 ===== First Steps ===== ===== First Steps =====
 +
 ==== Adding the Main Sidebar ==== ==== 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. 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.
  
Line 80: Line 94:
   [[some:more:links]]\\   [[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.+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 ==== ==== 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. 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 ==== ==== 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. 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 ==== ==== 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.  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 ==== ==== 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''. 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 ===== ===== Bugs / Feature Requests =====
-Please report bugs or feature requests at the [[http://github.com/chimeric/dokuwiki-plugin-sidebarng/issues|Bug tracker]].+ 
 +Please report bugs or feature requests at the [[https://github.com/chimeric/dokuwiki-plugin-sidebarng/issues|Bug tracker]].
  
 ===== Further Resources ===== ===== Further Resources =====
  
-  * [[http://github.com/chimeric/dokuwiki-plugin-sidebarng/tree/master|Git Repository]] +  * [[https://github.com/chimeric/dokuwiki-plugin-sidebarng|Git Repository]] 
-  * [[http://github.com/chimeric/dokuwiki-plugin-sidebarng/issues|Bug Tracker]]+  * [[https://github.com/chimeric/dokuwiki-plugin-sidebarng/issues|Bug Tracker]]
  
 ===== Changes ===== ===== Changes =====
  
-{{rss>http://github.com/feeds/chimeric/commits/dokuwiki-plugin-sidebarng/master}}+{{rss>https://github.com/chimeric/dokuwiki-plugin-sidebarng/commits/master.atom date}}
  
 ===== FAQ ===== ===== FAQ =====
  
 ==== It doesn't seem to work, the sidebars appear at the wrong place, what can I do? ==== ==== 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. That's most probably a caching issue - try CTRL+SHIFT+R in Firefox.
  
 ==== Change text alignment ==== ==== 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. Change the style.css in the plugin-folder. You'll need to empty the caches, otherwise the change will not show immediately.
  
 ===== Discussion ====== ===== Discussion ======
-**NOTE:** Don't post patches, bug reports or feature requests here. Use the [[http://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//+ 
 +**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]] 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.
 +
 +----
 +
 +<del>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]]
 +</del>
 +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:
 +<code css>
 +div.dokuwiki div.left_sidebar {
 +    display: none;
 +}
 +
 +div.dokuwiki div.right_sidebar  {
 +    display: none;
 +}
 +</code>
 +
 +==== Here is the code if you want to keep a fixed header, foot, sidebar and toc ====
 +
 +<code css>
 +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;
 +}
 +
 +</code>
 +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
 +<code php>
 +$this->doc .= '><a name="'.$hid.'" id="'.$hid.'">';
 +</code>
 +After
 +<code php>
 +$this->doc .= '><a class="anchor" name="'.$hid.'" id="'.$hid.'">';
 +</code>
plugin/sidebarng.1275430395.txt.gz · Last modified: 2010-06-02 00:13 by 71.198.156.157

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