X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/e5630ba6fdd97a423905ca5b49f74e871566345d..687f7f7b77d72e6e6ad6aa5f2323894cc87c1366:/doc/plugins/contrib/sidebar2.mdwn diff --git a/doc/plugins/contrib/sidebar2.mdwn b/doc/plugins/contrib/sidebar2.mdwn index 01aeaf558..5c169bfd4 100644 --- a/doc/plugins/contrib/sidebar2.mdwn +++ b/doc/plugins/contrib/sidebar2.mdwn @@ -1,9 +1,10 @@ +[[!meta author="spalax"]] [[!template id=plugin name=sidebar2 author="[[Louis|spalax]]"]] [[!tag type/chrome]] *Claim:* The [[sidebar|plugins/sidebar]] plugin has nothing to do with sidebars. This plugin renders some page (which happens to be named -`sidebar`) and put the result in template variable `SIDEBAR`, in template +`sidebar`) and put the result in template variable `SIDEBAR` of template `page.tmpl`. But the fact that it is a sidebar, i.e. a bar appearing on the side on the screen, is done by CSS. @@ -31,9 +32,16 @@ etc. The default, which gives the behaviour of the sidebar plugin, is `global_sidebars => ["sidebar", "sidebar", "*"]`. +*Remark: It would be more sensible to have a list of lists, as the following example, but I did not manage to do so because of [[this bug|bugs/structured_config_data_is_mangled]].* + + global_sidebars => [ + ["var1", "page1", "pagespec1"], + ["var2", "page2", "pagespec2"], + ] + # Improvements over sidebar plugin -* You can add several "sidebars" to your wiki. For example, to have a sidebar, a submeno that appear only in pages documentations, and a footer, your `global_sidebars` would be: +* You can add several "sidebars" to your wiki. For example, to have a sidebar, a submenu that appears only in documentation pages (`doc/*`), and a footer, your `global_sidebars` would be: global_sidebars => [ "sidebar", "sidebar", "*", @@ -66,12 +74,12 @@ template variable, the directive applies to the value given in the argument. For example, the following command forces the `footer` sidebar to appear on the current page. - [[!sidebar var=footer]] + \[[!sidebar var=footer]] The following command forces the `footer` sidebar to appaer, containing the content given in argument. - [[!sidebar var=footer content="TEST"]] + \[[!sidebar var=footer content="TEST"]] # Which pages to render? @@ -82,3 +90,7 @@ handled by this plugin. 2. If the page contains the [[sidebar|ikiwiki/directive/sidebar]] directive with no `content` argument, the first rule for the considered template variable is applied, disregarding the pagespec. 3. If none of the above, the first rule having its pagespec patching the current page is applied. 4. If none of the above, the variable is left empty. + +# Download and install + +Code and documentation: [[https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/Sidebar2]].