Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout RSS
Setup for multitemplate and monobook
Avatar
tobiaseigen #1
Member since Feb 2007 · 21 posts
Group memberships: Members
Show profile · Link to this post
Subject: Setup for multitemplate and monobook
Hi,

My goal is to create a single wiki install that serves up a variety of different wikis, all sharing the same code but each with its own version of the monobook template and associated wiki pages like user, talk etc. This seems very possible thanks to these two terrific DokuWiki projects, both developed by Tatewake and designed to work together:

Multitemplate
Monobook

I've made some progress but am coming up against some issues I don't know the answer to - would be grateful for input from more knowledgeable DokuWiki developers. I think this may be of use to others and would be glad to share what I learn.

What I've done so far:

1) Installed multitemplate in ~/lib/tpl/multitemplate as per instructions on tatewake.com

2) Installed multiple copies of the monobook template in ~/lib/tpl - one for each wiki - also as per instructions on tatewake.com

3) Created a namespace for each wiki - same name for each namespace and template

4) Created ACL for permissions for each namespace

5) So far, minimal customization of the monobook template for each namespace:
- unique logo
- set homepage for each namespace by editing the code referred to on the monobook talk page. Since this was a very handy discovery, let me paste it here too so it's all together in the same thread:

If logo-image is not wanted...

and its usual position is to be used for navigation links (adaptation of css), I believe that this small change to main.php is appropriate (search for p-logo, to find the position of this code in main.php):

<?php if (file_exists(dirname(__FILE__).'/user/logo.png')
or file_exists(dirname(__FILE__).'/user/logo.gif')
or file_exists(dirname(__FILE__).'/user/logo.jpg')) { ?>
<div class="portlet" id="p-logo">
    <a
    <?php if (file_exists(dirname(__FILE__).'/user/logo.png')) { ?>
    style="background-image: url(<?php echo $DOKU_TPL?>user/logo.png);"
    <?php } else if (file_exists(dirname(__FILE__).'/user/logo.gif')) {?>
    style="background-image: url(<?php echo $DOKU_TPL?>user/logo.gif);"
    <?php } else if (file_exists(dirname(__FILE__).'/user/logo.jpg')) {?>
    style="background-image: url(<?php echo $DOKU_TPL?>user/logo.jpg);"
    <?php } ?>
    href="<?php echo DOKU_BASE?>" accesskey="h" title="[ALT+H]">
    </a>
</div>
<?php } ?>

Borut, 2007-03-22

6) Now, where I'm getting into trouble is with trying to configure the monobook template for each namespace template. For some reason it does not want to recognize the configuration files in ~/lib/tpl/monobooktemplate/conf/default.php where I have set up all the various navigation, sitenotice, toolbox, talk pages etc for each namespaces. Here is what is added to local.conf when I update the configuration as per tatewake.com instructions - and it is always reflected across the whole site and not on a per-namespace basis:

$conf['tpl']['multitemplate']['mb_discussion_location'] = 'web_2.0:talk';
$conf['tpl']['multitemplate']['mb_sitenotice_location'] = 'site_notice_web20';
$conf['tpl']['multitemplate']['mb_navigation_location'] = 'navigation_web20';
$conf['tpl']['multitemplate']['mb_copyright_location'] = 'copyright_web20';
$conf['tpl']['multitemplate']['mb_toolbox_location'] = 'toolbox_web20';

Perhaps it is only possible to have one monobook template on a site? Is there a configuration change I can make that will make this possible?

Thanks!

Tobias
Tobias Eigen

Kabissa - Space for Change in Africa
http://www.kabissa.org
Avatar
tobiaseigen #2
Member since Feb 2007 · 21 posts
Group memberships: Members
Show profile · Link to this post
Boy, why is it that I am always able to answer my own questions?

A hack for handling my need in #6 - unique navigation for each namespace - is to do this:

First, find this code in ~lib/tpl/monobooktemplate/main.php

<?php if (function_exists('dwp_display_wiki_page')) dwp_display_wiki_page(tpl_getConf('mb_navigation_location')); ?>

And replace it with something like this code:

<?php if (function_exists('dwp_display_wiki_page')) dwp_display_wiki_page(tpl_getConf('ttgo_navigation_location')); ?>

Then open the ~conf/local.php file and add a line like this:

$conf['tpl']['multitemplate']['ttgo_navigation_location'] = 'navigation_ttgo';

Where "navigation_ttgo" is the wiki page containing the navigation for that namespace. Do this for each namespace that you want to have a unique navigation menu for.

Tell me there's an easier way to do this! :-)

Cheers,

Tobias
Tobias Eigen

Kabissa - Space for Change in Africa
http://www.kabissa.org
Avatar
tobiaseigen #3
Member since Feb 2007 · 21 posts
Group memberships: Members
Show profile · Link to this post
And a final update re my #6 issue - I got it sorted thanks to this help from Terence.

Cheers,

Tobias
Tobias Eigen

Kabissa - Space for Change in Africa
http://www.kabissa.org
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-03-20, 02:22:23 (UTC +01:00)