Difference between revisions of "Talk:Dynamic Page List"
From FollowTheScore
(New page: 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!) |
|||
Line 1: | Line 1: | ||
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! | 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 === | ||
+ | |||
+ | # please put a signature under your contributions. | ||
+ | # install the treeview extension | ||
+ | |||
+ | put the following into your LocalSettings.php | ||
+ | <pre> | ||
+ | |||
+ | # 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; | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | 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) { ?> | ||
+ | |||
+ | [[User:Gero|Gero]] 20:25, 14 December 2007 (CET) |
Revision as of 20:25, 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
- please put a signature under your contributions.
- 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) { ?>
Gero 20:25, 14 December 2007 (CET)