Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > d8544620e4ac7bee48ddb48c85d55709 > files > 306

ikiwiki-3.20190228-1.mga7.noarch.rpm

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>sidebar2 (third party plugin)</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" href="../../style.css" type="text/css" />

<link rel="stylesheet" href="../../local.css" type="text/css" />






<meta name="author" content="spalax" />



</head>
<body>

<div class="page">

<div class="pageheader">
<div class="header">
<span>
<span class="parentlinks">

<a href="../../index.html">ikiwiki</a>/ 

<a href="../../plugins.html">plugins</a>/ 

<a href="../contrib.html">contrib</a>/ 

</span>
<span class="title">
sidebar2 (third party plugin)

</span>
</span>



</div>









</div>





<div id="pagebody">

<div id="content" role="main">
<p><span class="infobox">
Plugin: sidebar2<br />
Author: <span class="createlink">Louis</span><br />
Included in ikiwiki: no<br />
Enabled by default: no<br />
Included in <a href="../goodstuff.html">goodstuff</a>: no<br />
Currently enabled: no<br />
</span></p>

<p><em>Claim:</em> The <a href="../sidebar.html">sidebar</a> plugin has nothing
to do with sidebars. This plugin renders some page (which happens to be named
<code>sidebar</code>) and put the result in template variable <code>SIDEBAR</code> of template
<code>page.tmpl</code>. But the fact that it is a sidebar, i.e. a bar appearing on the
side on the screen, is done by CSS.</p>

<p>What if I want a sidebar, and a <a href="./navbar.html">navigation bar</a>, and
a footer a bit more elaborated than the one in the template, etc.? This plugin
allows this.</p>

<h1>Configuration</h1>

<p>If no option is given, or if option <code>global_sidebars</code> is a boolean, this plugin
is identical to the <a href="../sidebar.html">sidebar plugin</a> (if not, please <a href="https://atelier.gresille.org/projects/gresille-ikiwiki/issues">report
a bug</a>).
Otherwise, <code>global_sidebars</code> is a list of sidebars to include. The list is as
follow:</p>

<pre><code>global_sidebars =&gt; [
  "var1", "page1", "pagespec1",
  "var2", "page2", "pagespec2",
  ]
</code></pre>

<p>The meaning is: if available, render <code>page1</code> in pages matching <code>pagespec1</code>, and
put it in variable <code>var1</code> of the page template, and so on for <code>var2</code>, <code>page2</code>,
etc.</p>

<p>The default, which gives the behaviour of the sidebar plugin, is
<code>global_sidebars =&gt; ["sidebar", "sidebar", "*"]</code>.</p>

<p><em>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 <span class="createlink">this bug</span>.</em></p>

<pre><code>global_sidebars =&gt; [
  ["var1", "page1", "pagespec1"],
  ["var2", "page2", "pagespec2"],
  ]
</code></pre>

<h1>Improvements over sidebar plugin</h1>

<ul>
<li><p>You can add several "sidebars" to your wiki. For example, to have a sidebar, a submenu that appears only in documentation pages (<code>doc/*</code>), and a footer, your <code>global_sidebars</code> would be:</p>

<p>global_sidebars =&gt; [
    "sidebar", "sidebar", "<em>",
    "menu", "/doc/menu", "doc/</em>",
    "footer", "/footer", "*"
    ]</p></li>
<li><p>You can enable sidebars only in certain pages matching the pagespec. If, for
the same template variable, several pagespec match the current page, the
first page in the list is taken into account.</p>

<p>For example, the following configuration says: render <code>menu</code> as the sidebar
for every page, excepted subpages of <code>doc</code>, for which the <code>doc_menu</code> page
should be rendered.</p>

<p>global_sidebars =&gt; [
    "sidebar", "doc_menu", "doc/<em>",
    "sidebar", "menu", "</em>",
    ]</p></li>
</ul>

<h1>Directive</h1>

<p>The behaviour of the <code>sidebar</code> directive is similar to the directive of the
original <a href="../sidebar.html">sidebar</a>, excepted that a new <code>var</code> argument is
available.</p>

<p>If this <code>var</code> argument is set, instead of applying to the default <code>sidebar</code>
template variable, the directive applies to the value given in the argument.</p>

<p>For example, the following command forces the <code>footer</code> sidebar to appear on the
current page.</p>

<pre><code>[[!sidebar  var=footer]]
</code></pre>

<p>The following command forces the <code>footer</code> sidebar to appaer, containing the
content given in argument.</p>

<pre><code>[[!sidebar  var=footer content="TEST"]]
</code></pre>

<h1>Which pages to render?</h1>

<p>Here is the decision process to decide what is rendered in a template variable
handled by this plugin.</p>

<ol>
<li>If the page contains the <a href="../../ikiwiki/directive/sidebar.html">sidebar</a> directive, with a <code>content</code> argument, this content is rendered.</li>
<li>If the page contains the <a href="../../ikiwiki/directive/sidebar.html">sidebar</a> directive with no <code>content</code> argument, the first rule for the considered template variable is applied, disregarding the pagespec.</li>
<li>If none of the above, the first rule having its pagespec patching the current page is applied.</li>
<li>If none of the above, the variable is left empty.</li>
</ol>

<h1>Download and install</h1>

<p>Code and documentation: <a href="https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/Sidebar2">https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/Sidebar2</a>.</p>

</div>







</div>

<div id="footer" class="pagefooter" role="contentinfo">

<div id="pageinfo">




<div class="tags">
Tags:

<a href="../type/chrome.html" rel="tag">type/chrome</a>

</div>








<div class="pagedate">
Last edited <span class="date">Tue Feb 26 23:01:54 2019</span>
<!-- Created <span class="date">Tue Feb 26 23:01:54 2019</span> -->
</div>

</div>


<!-- from ikiwiki -->
</div>

</div>

</body>
</html>