For our purposes, I created a little patch for Dokuwiki, which allows you to specify a default page to open, when somebody opens a namespace in the index list. Furthermore, the patch displays the namespace titles in a nice way in the index (capitalized words with spaces). Together with the already existing option "useheading", these two changes make the index a very nice navigation, especially when used in a template that uses the index like a sidebar. $conf['defaultindex'] = 'index'; $conf['useheading'] = 1; Feel free to include the patch in Dokuwiki if you think it is useful (maybe with an extra configuration option for the namespace-prettying). Thanks for this nice code, Frank
diff -ur --exclude=data --exclude=sherpa dokuwiki-2006-03-09/inc/html.php wiki/inc/html.php --- dokuwiki-2006-03-09/inc/html.php 2006-03-09 21:32:34.000000000 +0100 +++ wiki/inc/html.php 2006-05-16 14:25:19.000000000 +0200 @@ -597,12 +597,17 @@ * @author Andreas Gohr <andi@xxxxxxxxxxxxxx> */ function html_list_index($item){ + global $conf; $ret = ''; $base = ':'.$item['id']; $base = substr($base,strrpos($base,':')+1); if($item['type']=='d'){ - $ret .= '<a href="'.wl($ID,'idx='.$item['id']).'" class="idx_dir">'; - $ret .= $base; + if($conf['defaultindex']=='') { + $ret .= '<a href="'.wl($ID,'idx='.$item['id']).'" class="idx_dir">'; + }else { + $ret .= '<a href="' . wl($item['id'].":".$conf['defaultindex']) . '">'; + } + $ret .= ucwords(str_replace("_"," ",$base)); $ret .= '</a>'; }else{ $ret .= html_wikilink(':'.$item['id']); @@ -658,8 +663,17 @@ $opens = 0; $ret = ''; + global $conf; foreach ($data as $item){ + if( ($conf['defaultindex']!='' && + preg_match('/'.$conf['defaultindex'].'$/',$item['id']) && + $item['level']!=1 + ) + ) { + continue; + } + if( $item['level'] > $level ){ //open new list for($i=0; $i<($item['level'] - $level); $i++){