Difference between revisions of "Talk:Dynamic Page List"

From FollowTheScore
Jump to: navigation, search
Line 44: Line 44:
 
directly before this (existing) line
 
directly before this (existing) line
 
  <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
 
  <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
 +
 +
Write your tree into the Document "NavTree"
  
 
[[User:Gero|Gero]] 20:25, 14 December 2007 (CET)
 
[[User:Gero|Gero]] 20:25, 14 December 2007 (CET)

Revision as of 20:26, 14 December 2007

hello,now i want to adust my wiki navigation bar like this, having a treeview,but i don't know how to do it? can you help me? thank you very much!

Reply

  1. please put a signature under your contributions.
  2. install the treeview extension

put the following into your LocalSettings.php


# Treeview
require_once( "$IP/extensions/Treeview/Treeview.php" );

$wgTreeViewImages = array(
    'plus'     => "Plus.gif",
    'minus'    => "Minus.gif",
    'opened'   => "Folder_opn_sml_blu.gif",
    'closed'   => "Folder_sml_blu.gif",
    'doc'      => "Doc-icon.gif",
    'spacer'   => "Blank.gif",
    'vert'     => "Vertline.gif",
    'node'     => "Node.gif",
    'lastnode' => "Lastnode.gif",
);
#$wgTreeViewShowLines = true;
// we added a new hook to skins/Monobook.php at the top of the sidebar
$wgHooks['MonoBookTemplateSidebarBegin'][] = 'wfNavTree';
function wfNavTree() {
        global $wgUser,$wgTitle,$wgParser;
        if (is_object($wgParser)) $psr =& $wgParser; else $psr = new Parser;
        $opt = ParserOptions::newFromUser($wgUser);
        $nav = new Article(Title::newFromText('NavTree'));
        $out = $psr->parse($nav->fetchContent(0,false,false),$wgTitle,$opt,true,true);
        //echo '</ul></div>'.$out->getText();
        echo $out->getText();
        return true;
}

and change Monobook.php:

You must add the following line

<?php wfRunHooks( 'MonoBookTemplateSidebarBegin', array( &$this ) ); ?>

directly before this (existing) line

<?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>

Write your tree into the Document "NavTree"

Gero 20:25, 14 December 2007 (CET)