Please see SVN Access for information regarding DokuWiki projects.
Your Donations help keep my Software going!

Talk:Projects:Multitemplate for DokuWiki

  • Start all subtopics using H2. (Heading 2.)

Sites using this template

Link your site here if you wish

Thank you very much for your outstanding work, in my opinion your Monobook for Dokuwiki, and the multi-template plugin are the best additions for Dokuwiki in the world! - You are the Greatest! Thank you!

Pasha

Better way to integrate style.ini templates?

If someone has a better way to integrate style.ini templates with multitemplate, please reply and the solution will be integrated into the project. — Terence J. Grant 06/24/2006 00:52
I've created an action plugin solving the problem with style.ini: http://wiki.splitbrain.org/plugin:multitemplate_stylemanPascal Bihler 05/15/2007 14:38

Awesome Pascal! I've added a link to this to the main page. — Terence J. Grant 05/17/2007 01:52

Careful with tplSwitcher (Template Switcher)

Don't use this plugin with multitemplate. In my case it caused chaos.

Peter

Bug reading template configuration settings

When I'm using the sidebar-template, the configuration settings are important. If there are no configuration settings, the sidebar will not be shown.

Now I noticed that the current version of multitemplate is not able to aquire the configuration settings for sidebar, when it is used in a sub-namespace.

A quick-and-dirty workaround will help:

Modify ./lib/tpl/multitemplate/conf/meat.php, add the following code on top:

// Workaround
if (isset($ID) == FALSE) {
  $ID    = getID();
}
// /Workaround

It seems, that the $ID-Variable is never set, when this skript will be run.

Peter

Multitemplate still broken for monobook?

Hi - I have just spent a few hours trying to get multitemplate working, and have finally found this annoucnement from Dec 20 2006 indicating that it's broken. What is wrong with it, and could you please fix it? Currently I am fairly sure I have installed it correctly, but it seems stylesheets are not being referred to correctly (looks for them in /lib/tpl/multitemplate instead of in /lib/tpl/monobook

Thanks much! Tobias Eigen

Multitemplate is not broken, the fix for January was to do with the configuration manager.

My guess based on your problem is that you haven't turned off “compact CSS and JavaScript files” in the main configuration settings. This is absolutely required.

I've expressed my feelings regarding this buggy (and fairly useless) feature existing in DokuWiki, as well as it being on by default since it causes so many headaches (like caching the wrong CSS files when you change templates.)

Additionally, you'll probably need to do a “force refresh” by holding down the “modifier keys” (that's shift, alt, and control) while hitting the refresh button (with the mouse) on your browser (I'll add a note to the project page for this.)

I'm fairly confident this will fix your problems though. — Terence J. Grant 03/23/2007 22:35

Geez, it's even worse than I thought. Not only is it not broken but I'm a complete idiot. I accidentally uploaded the multitemplate to the wrong location (plugins not tpl) so obviously it was not working. Now it is! Like a charm!! Thanks much! Tobias Eigen

Multitemplate "headers already sent" issue

Hi -

I'm getting the following error message when saving configuration settings in my dokuwiki, with the multitemplate installed. I am suspecting this is related to another problem I am having, which is that I can't get the configuration to be different for each of my templates (I'm using copies of monobook for each namespace, e.g. monobook_web20, monobook_ttgo etc). The different configurations work when I'm not using multitemplate and directly using eg monobook_ttgo but not when I have the multitemplate selected as the template. Otherwise it seems to be using the different templates, as I've got different logos for each and they are showing up.

Warning: Cannot modify header information - headers already sent by (output started at /var/www/foo/wiki/lib/tpl/multitemplate/conf/default.php:11) in /var/www/foo/wiki/lib/plugins/config/admin.php on line 84

Thanks much for any guidance -Tobias Eigen
I found the cause of the “headers already sent” issue .. see here: http://wiki.splitbrain.org/wiki:faq:sessioncookie - but am still struggling to get my configuration files to be different for each template. This is driving me nuts. -Tobias Eigen

If you're using multiple copies of the same template, which is something i really never expected, you'll have to change some things within the template's code…

  1. Search for the function name “tpl_getConf” in all of the php files in the template, and change the parameter name per template…
    • So for instance, if you find tpl_getConf('mb_use_sitenotice'), you'll need to call one 'mb_...', perhaps another 'mb_web20_...' and 'mb_ttgo_...' and so on for each, this differing per template directory.
  2. You'll then need to go to the “conf” directory for each template, and modify both default.php and metadata.php to do the same thing.
  3. You'll then want to do the same thing with “lang/en/settings.php” or whatever your default language is and change that as well.

I believe that should be enough to fix everything for you. — Terence J. Grant 03/27/2007 19:17

You are right, Terence - many thanks! I got part of the way there myself a while after posting this.. see http://forum.dokuwiki.org/post/2574;nocount for details, and below for the record the files that need to be changed. This is a cumbersome process and if ever you find a way to handle this issue in future upgrades it would be massively useful, at least to me. Having distinct navigation, talk and other notices etc is very useful indeed, even when using the same brilliant template for all of them.

1) Added the following to ~conf/local.protected.php for each namespace

$conf['tpl']['multitemplate']['ttgo_use_discussion'] = 1;
$conf['tpl']['multitemplate']['ttgo_discussion_location'] = 'talk';
$conf['tpl']['multitemplate']['ttgo_use_navigation'] = 1;
$conf['tpl']['multitemplate']['ttgo_navigation_location'] = 'navigation_ttgo';
$conf['tpl']['multitemplate']['ttgo_use_sitenotice'] = 1;
$conf['tpl']['multitemplate']['ttgo_sitenotice_location'] = 'sitenotice_ttgo';
$conf['tpl']['multitemplate']['ttgo_use_copyright'] = 1;
$conf['tpl']['multitemplate']['ttgo_copyright_location'] = 'copyright_ttgo';
$conf['tpl']['multitemplate']['ttgo_use_toolbox'] = 1;
$conf['tpl']['multitemplate']['ttgo_use_defaulttoolbox'] = 1;
$conf['tpl']['multitemplate']['ttgo_toolbox_location'] = 'toolbox_ttgo';
$conf['tpl']['multitemplate']['ttgo_author'] = 'Anonymous Contributors';

2) Replaced the code as you suggested where they appear in these three files in the template:

context.php main.php lang/en/settings.php

3) And also updated the default.php and metadata.php files in the template/conf dir. Tobias Eigen

Template not applied

Hi !

I would like to try Multitemplate for DokuWiki but, after the installation's procedure, when I force the refresh of my start-page, I obtain a page with all the content but without any css file applied… I don't understand why.
To give more details, I used only two templates : the default template and a copy of this one, called “mywiki”, with only one change in the layout.css (background-color of the bar changed into red). I assigned the default template to the playground and the “mywiki” template for all the other pages.
Thank you for your help.
François
PS : Sorry if my english is not so good… I did my best but ask me if something is not clear in my explanation !


EDIT : I found the problem : default template needs style.ini file… So it needs multitemplate_styleman plugin… ;-)

Bug report with latest version

I believe I do have a bug report for multitemplate on rc2008-04-11. *Update: Same problem with 2008-05-05, same way to solve* If this was somehow my template's fault rather than multitemplate's or dokuwiki's, please don't kill me :) I have quite a lot of things to sort out right now and my top priority was to get it fixed as fast as possible.

I had a dokuwiki installation running multitemplate and the assistant plug-in with three different, self-made themes.

When I upgraded to rc2008-04-11, all pages showed up broken, only the naked content appeared with no CSS definitions at all.

I quickly determined this to be because multitemplate_styleman's css.php did *not* output my template's style sheets even though the style.ini file definitely contained them. Long story short, the error turned out to be in /lib/exe/css.php.

around line 44, you find

 $tpl = trim(preg_replace('/[^\w-]+/','',$_REQUEST['t']));
 if($tpl){ 
      $tplinc = DOKU_INC.'lib/tpl/'.$tpl.'/';
      $tpldir = DOKU_BASE.'lib/tpl/'.$tpl.'/';
      
         
       
  }else{ 
      $tplinc = DOKU_TPLINC;
      $tpldir = DOKU_TPL;
  }

$tpl needed to be false for my templates to work and the DOKU_TPLINC/DOKU_TPL constants become authoritative. To leave everything else intact, I put a

  $tpl = false

directly below the first line quoted above ($tpl = trim…).

I do not have full understanding of the mechanisms in play here, and whether this really is a bug or something to do with my templates. But maybe the next person with the same problem can reach the solution quicker now.

Pekka (p@pekkagaiser.de)

Auto-update translated namespaces

I use multitemplate and translations. I did not want to have to update the multitemplate settings for each language, so here is a small extension that automatically applies your $multitemplate settings to every language registered with the translation plugin.

Copy and paste at the very end of multitemplate/local_pref.php, right before the closing ”?>”.

  
/* Automatically adds all languages registered with the translation plugin
   to each and every $multitemplate entry. 
   eg. with the languages Italian, German, and Dutch registered, the $multitemplate entry
  
   $multitemplate["my_personal_page"] = "personaltemplate"]
  
   will become
  
   $multitemplate["my_personal_page"] = "personaltemplate"]
   $multitemplate["it:my_personal_page"] = "personaltemplate"]
   $multitemplate["de:my_personal_page"] = "personaltemplate"]
   $multitemplate["nl:my_personal_page"] = "personaltemplate"]
 
   automatically.
 
  
  @author Pekka Gaiser <p@pekkagaiser.de>
*/

if (isset($conf['plugin']['translation']['translations']))
{

// Borrowed parsing routine for the "translations" string from the latest version of the translations plugin

$languages = strtolower(str_replace(',',' ',$conf['plugin']['translation']['translations']));
$languages = array_unique(array_filter(explode(' ',$languages)));
sort($languages);


/* Now we have all translation languages in an array.
   Each entry in $multitemplate will now be completed by an entry each language there is. */

// We make a copy of $multitemplate to not confuse the loop

$multitemplate_tempCopy = $multitemplate;

// Go through every $multitemplate entry and there, through every language.

foreach ($multitemplate_tempCopy as $key => $value)
 {
	
	 foreach ($languages as $language)
	 $multitemplate[$language.":".$key] = $value; 
	 
	 
 } // end foreach

unset ($multitemplate_tempCopy);

} // end if isset

Pekka (p@pekkagaiser.de)


Personal Tools