Sie befinden sich hier: Krischer.org » Code » php » snipplets » No "start" in the Dokuwiki Menu

No "start" in the Dokuwiki Menu

Some Dokuwiki templates come with a sidebar which contains an autogenerated menu with all namespace and files linked in a folder tree. If you click a folder, the „start“ file is accessed and there’s also an entry for the page. In some installations I don’t want this entry, so I fixed it with this simple code. Go for dokuwiki/lib/tpl/$TEMPLATENAME/sidebar.php and modify function tpl_list_folder($dataList)

Add the followin code right before the if($perm > 0){ line

dokuwiki/lib/tpl/$TEMPLATENAME/sidebar.php

/* Kicks out the entry for start pages
added by manuel@krischer.org 01/2010  */
 
if(strpos($dataList[$i]["id"], $conf['start'])) {
    continue;
}

As soon as the Entry with the start file name is processed, it will skip to the next in the list.

Attention: Due to some String compare problems, the first „start“ is not removed. If you really want to remove ALL start pages including your first page, use this code instead:

/* Kicks out the entry for start pages
added by manuel@krischer.org 01/2010  */
 
if(strpos($dataList[$i]["id"], $conf['start']) !== false) {
    continue;
}
 
Nach oben
code/php/snipplets/no_start_menuentry_dokuwiki.txt · Zuletzt geändert: 2010/01/18 01:35 von Manuel Krischer
edv-krischer.de Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0