[dokuwiki] Sidebar tweak for Starter template

  • From: "Filippo A. Salustri" <salustri@xxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 30 Jun 2012 23:19:23 -0400

Hi all,
(Please be gentle; this is my first post to this list, and I've only
been running dokuwiki for all of 2 days.)

I'm using starter template because - well, it's good for beginners.
It's working wonderfully.

But I really want to be able to alter the contents of the sidebar in
the starter template.
Starter seems to include only the sidebar in the root namespace.
First, I tried using the include plugin to include .:sidebar, so that
no matter what namespace I was in, the local sidebar would load.
I was hoping that when the include was processed, the current
namespace would have been the one of the page.
However, it didn't seem to be that, because the local sidebar would
never show up.

So I came up with a little hack that seems to work.
I changed the code in starter's main.php so that it loads the local
sidebar rather than the one in the root namespace.
Then, if I want to include other sidebars, I can refer to them
explicitly (e.g. ":sidebar" to include the root sidebar).

It seems to work well, and I wanted to share the tweak, because I
didn't find evidence of it elsewhere on the web.
Find this code in starter's main.php:
<!-- ********** ASIDE ********** -->
            <div id="dokuwiki__aside"><div class="pad include">
                <?php tpl_include_page(tpl_getConf('sidebarID')) /*
includes the given wiki page */ ?>

And change it to this:
<!-- ********** ASIDE ********** -->
            <div id="dokuwiki__aside"><div class="pad include">
                <?php tpl_include_page ( getNS(cleanID(getID())) . ":"
. tpl_getConf('sidebarID')) /* includes the sidebarID page from the
namespace. */ ?>

Comments/suggestions are welcome.

Thanks for a great wiki!

Fil Salustri
--
\V/_
Filippo A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salustri@xxxxxxxxxx
http://deseng.ryerson.ca/~fil/
--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: