Extension talk:TreeAndMenu

Nesting Menu with Tree
Probably more of a feature request but would be nice to be able to handle for example If there is a hack for this please divulge. Goldbishop 18:26, 12 July 2010 (UTC)

Duplicating page TOC
Any tips for using this extension to duplicate a page's TOC? --Two7s clash 17:31, 17 April 2010 (UTC)

How to insert #menu into a 
I installed your extension TreeAndMenu. I have build a page with the #menu function with 3 sublevels. Displaying the menu or tree in the sidebar is no problem, but now I want to show the menu in a div-tag. Is there any way to do that? I would be thankfull for a solution.

best regards

--Crumpet 13:48, 17 February 2010 (UTC)

Bug Fix for Tree not display
I found some bug in TreeAndMenu.php. It will generate a worinag javasciptr path. Find this code: $wgOut->addScript("baseUrl}/dtree.js\"> \n"); Replace as  $wgOut->addScript(" \n"); If your extensions path not default Replace as : $wgOut->addScript(" \n");

Problems on links in tree
Hi there, I like your TreeView. But there are some Problems for me... - when I add just text everything is fine. When I add links   in preview everything is still fine. But when I save the #tree closes right before the first link. Example:

SectionA  Of course when the brackets are closed the following stuff is not included. Anyone knows how to repair this? btw: I use MW 1.11.0, FireFox, MacOS, MAMP Ben


 * Sorry I haven't come across that problem before, is it the latest treeview version? --Nad 07:02, 28 January 2008 (UTC)

I also have the above problem
same problem as above. i'm using latest version of treeview from SVN on MW 1.14. plz help


 * Jack

I also have the above problem
same problem as above. i'm using latest version of treeview from SVN on MW 1.15.1. I Thimk that there is a problem in the editor parser. When using Wikitext like [, [[, are added bevor the Wikitext. I would be thankfull for a solution.
 * Joerg Wiemann

version 4.0.9
--Tepo 21:18, 20 January 2008 (UTC)

I've installed Treeview4, version 4.0.9 on a MW 1.6.10. The code is properly included, the image paths (in the source of the article page) refer to the right locations (the gif files are all there where the paths refer to) and the JS script is included in the source page as expected. But the tree is rendered literally as if it was a standard wiki article and as if the magic word was never acted upon. The icons do not show up; the treeview table is not being defined. From tracing the Treeview4 source code, my impression is that neither function Tree nor function treeview are invoked. It looks as if nothing happens after function Treeview4 has executed. Any suggestions how to resolve this?
 * The # symbol is not implied in some older versions of mediawiki, so you may need to either remove the # from the wikitext, or set $wgTreeView4Magic to "#tree" instead of just "tree" --Nad 06:54, 28 January 2008 (UTC)
 * Solved! Thanks a lot! --Tepo 20:42, 1 February 2008 (UTC)

Treeview not displayed

 * 1) i create file Treeview4.php
 * 2) insert code in localsettings
 * 3) but, if i insert in Mediawiki:sidebar, menu not displayed. in Mediawiki:sidebar i insert example from docs.
 * If you want the tree to work in sidebar, you have to add the skin hack to allow the sidebar article to render wikitext, see Sidebar for more detail about that. --Nad 06:48, 28 January 2008 (UTC)

Treeview suddenly stopped working in Navbar
Hello... we have a very strange problem... there have been no changes to the MediaWiki version or Treeview version, but all of a sudden, insted of the Navbar displaying normally, it is full of lines like this:

UNIQ136a4e0848c93b3c-TreeViewRowStart-00000001-QINUsite�UNIQ136a4e0848c93b3c-TreeViewRowEnd-00000002-QINU �UNIQ136a4e0848c93b3c-TreeViewRowStart-00000003-QINUIntroduction�UNIQ136a4e0848c93b3c-TreeViewRowEnd-00000004-QINU �UNIQ136a4e0848c93b3c-TreeViewRowStart-00000005-QINUHow it works�UNIQ136a4e0848c93b3c-TreeViewRowEnd-00000006-QINU �UNIQ136a4e0848c93b3c-TreeViewRowStart-00000007-QINUScreenshots�UNIQ136a4e0848c93b3c-TreeViewRowEnd-00000008-QINU

See it live here:

http://passwordmaker.org

This is on a shared hosting server (asmallorange) - anyone have a clue what might be causing this?
 * I have no idea why that would suddenly change if no changes were made to any of the code or extensions. I'd recommend upgrading to the latest version as treeview 4 is more reliable code than 3.x. --Nad 06:45, 28 January 2008 (UTC)
 * Never mind - figured it out... !@#$#$^%^ hosting company enabled zend.ze1_compatibility_mode... sorry for the noise.

White block with width 100%
Help please, i integrate treeview in sidebar and edit monobook.css, but all the same i see a white block with width 100%. In ie6 this block down on content.

look:

How delete white block, all resize to necessary size?

PS: I try with width=100% in css - no result.
 * It must be a css problem, try installing firebug into firefox and then right-click and "inspect element" to see what css rules your tree container has had applied to it --Nad 07:27, 8 February 2008 (UTC)

You probably hadn't placed  around the trees in the sidebar. This would cause the error you describe. (See ). I had this same problem when I upgraded from TreeView4. --Niskitonf 18:58, 20 October 2009 (UTC)

Monobook.css How-to?
Ok, I'm a dummie... so how do I add the Monobook.css stylesheet to our MediaWiki as described so I can change the font size back down to a more reasonable size... which begs the question, why is it so much bigger when going from 3.6 to 4.0.9?

Thanks --
 * Just navigate to your Article MediaWiki:Common.css and there you can change yout css code. Ben --212.184.19.70 07:11, 19 February 2008 (UTC)

MW 1.12+
Any chance this thing is going to work on MW 1.12, PHP 5? Tim Laqua talk 19:55, 28 February 2008 (UTC)
 * Treeview5.x will be made to work with 1.12, we don't have a 1.12 set up to test on yet, what's it doing wrong? --Nad 19:58, 28 February 2008 (UTC)
 * It's all crazy, here's the HTML that results from the parser function example on Organic Design:

&lt;treeview547c711fe2c3f3 id='47c711fe2c3f3' openlevels=4 root='My example tree'&gt;*Node 1 Node 1.1 Node 1.1.1 Node 1.1.1.1   </li></ul> </li>Node 2 </li>Node 3 </li>Node 4 </li>My Pictures The trip to Iceland </li>Mom's birthday </li></ul> </li>Recycle bin&lt;/treeview547c711fe2c3f3&gt; </li></ul> I've got a 1.12 install set up to work with now and have worked out a solution which should get it working on 1.12, it should be ready within the next few days --Nad 10:20, 29 February 2008 (UTC)
 * Can I get a quick hack (or some direction) to get it working in the mean time? Tim Laqua talk 13:19, 29 February 2008 (UTC)
 * As soon as I get it working I'll update the code. The parser has undergone massive changes in 1.12 and I've had to work out a different way to do the main parser function. --Nad 02:20, 1 March 2008 (UTC)
 * 5.1.0 is ready and tested fine on 1.11 and 1.12, it's almost a complete rewrite, so there may be some new problems crop up --Nad 21:10, 2 March 2008 (UTC)

Use cookies?

 * Has anybody added cookie functionality to this extension yet? It would be great if opened/closed trees remained that way from page to page. SeanFromIT 18:36, 2 October 2007 (UTC)
 * I'm back on tree now and working on custom images and persistence --Nad 00:58, 3 October 2007 (UTC)
 * Persistence is now available via cookies in version 5.x.x --Zven 23:01, 10 March 2008 (UTC)

Suggestion - add thumbnailing of images
I use the following (from line 63 of Treeview5.php) to transform down to 18px: $image = Image::newFromTitle($title); if ($image && $image->exists) { $thumb = $image->transform( array( 'width' => 18 ) ); $v = $thumb->getUrl; } else { $wgTreeViewImages[$k]; } Tim Laqua talk 21:46, 3 March 2008 (UTC)

Where to put tree list?
The plugin looks great and I'm anxious to use it. However, the latest documentation appears to be missing something:

>>Usage

>>Tree-views are created by surrounding a normal nested bullet list within the following couple of examples:

That's great, but with all of the supporting files for MediaWiki, which one of the hundreds of files do I put this in? I'm assuming it goes in Monobook.php, but I'm not sure. I've tried putting it in both Monobook.php and LocalSettings.php, both of which give me a parse error when it hits the first bullet:

Parse error: syntax error, unexpected '*'

What am I missing here?

Thanks, Scott
 * I'm not quite sure what you mean? are you asking where you put the bullet list? it's wikitext and you put it in the article where you want the tree to be... or are you referring specifically to how to put a tree in the sidebar? if so see Sidebar... otherwise please explain what you're trying to do and what the problem is more clearly. --Nad 04:35, 4 March 2008 (UTC)

Nad - Thanks, you answered my question. I wanted the tree view to be in the Wiki Side Bar, as well as a nav tree once I get to a particular page. I'll take a look at the side bar info and see if I can make the appropriate change(s).

Strange Error
I am getting a javascript error and I am not sure what it means of how to fix it.

invalid flag after regular expression for (i in tree.icon) tree.icon[i] = '/wdev_wiki/extensions/TreeView/'+tree.icon[i];/data/www/mediawiki/extensions/TreeV... ---^

Any ideas? Thanks, Pete.

I figured this out! At line 166 in 'TREEVIEW5_VERSION','5.1.4, 2008-03-05' there seems to be a typo. Line 166 is: for (i in tree.icon) tree.icon[i] = '{$this->baseUrl}/'+tree.icon[i];{$this->images} But should look like: for (i in tree.icon) tree.icon[i] = '{$this->baseUrl}/'+tree.icon[i];

I hope it was a typo and I have not broken something else but it seems to work great now.

Thanks for all your hard work Nad

Proposed Code Change for TREEVIEW5_VERSION 5.1.4 2008-03-05
This change will make arguments passed to each tree render in that tree rather than the last arguments applying to all the trees on a page.

Change Line 150 from $add = isset($args['root']) ? "tree.add(0,-1,'".$args['root']."');" : ''; to: $adds[$id] = isset($args['root']) ? "tree.add(0,-1,'".$this->args[$id]['root']."');" : '';

Change Link 167 from: $add to: $adds[$id]
 * Thanks, good spotting! actually it was a bug in line 148, where


 * needed to be changed to


 * I've updated the code to version 5.1.5 with the bug fixed :) --Nad 20:08, 6 March 2008 (UTC)

Error with Treeview5 & DPL
I am consistently getting

when trying to use DPL in conjunction with Treeview5. This is the code I am trying to use to dynamically create a listing for a Category:

The tree that is being displayed looks like I'd expect, it's just the error that's the issue.

Thoughts on what I'm doing wrong? I'm by no means a DPL expert but that appears to be working OK.

MW 1.11.2 (I was running Treeview 5.1.3 and just saw that you updated to 5.1.5 and tried that with the same results)

aldon
 * Was a typo in the code, try 5.1.6 --Nad 02:01, 8 March 2008 (UTC)
 * Perfect! Thanks,aldon

$wgOut->addScript(...) for adding JS in Treeview5.php produces invalid xhtml
The following is invalid xhtml (and breaks everything until an explicit closing SCRIPT tag is found): <script src="..." /> It needs to have an explicit closing tag: <script src="..." > Tim Laqua talk 02:44, 8 March 2008 (UTC)
 * Thanks, I've added the closing tag --Nad 09:44, 8 March 2008 (UTC)

Internet Explorer 7 not rendering tree view
Hello Nad, I have just installed treeview5 (latest version 5.1.7) and it is working fine on firefox but is not rendering in IE7. Indeed, the same happens when I try viewing pages from organicdesign so it's not related to my installation. The IE error log that show up in the bottom left hand corner says: "object doesn't support this property or method". I have tried this from two different computers. --Apap 18:56, 8 March 2008 (UTC)
 * Thanks for letting me know, I'll see if I can figure out what's up with it asap --Nad 06:02, 9 March 2008 (UTC)
 * Found the problem, in IE the JS object identifier names are not allowed to be the same as element id's --Nad 06:22, 9 March 2008 (UTC)
 * Have you uploaded the new Treeview5.php? Even though the link says 5.1.8 the actual php file still says 5.1.7 inside. I tried it but it has not resolved my IE page renderinng (though organicdesign renders correctly now). Thanks! --Apap 16:54, 9 March 2008 (UTC)
 * Doh - sorry no I hadn't uploaded the 5.1.8 changed - done now :-) --Nad 20:14, 9 March 2008 (UTC)

TreeView not rendering at all
Hi, I updated my MW from 1.9.2 to 1.12.0 and was forced to update TreeView from Version 4 to 5.1.9 therefore, too. Then I discovered that the tree wouldn't be rendered anymore at all. The rest of the page is shown without problems, except an error in the browser. I checked that and found that the problem could be caused using windows as server os. The path is built in windows notation.

part of the browser page source code <script type="text/javascript" src="/wiki/skins/common/wikibits.js?116"> <script type="text/javascript" src="C:\Wiki\xampp\htdocs\wiki\extensions\Treeview5\dtree.js"> <script type="text/javascript" src="/wiki/skins/common/ajax.js?116">

The followng line(57) in treeview5.php causes the problem rendering the path in "C:\Wiki\xampp\htdocs\wiki\extensions\Treeview5": $this->baseUrl = preg_replace('|^.+(?=/extensions)|',$wgScriptPath,$this->baseDir);

The used parameter is set: $wgScriptPath = "/wiki";

I changed your code to the following quick hack and it works now: $this->baseUrl = '/wiki/extensions/Treeview5';

It would be nice if you could check that and give me a quick reply how I should proceed. Thanks in advance. --Chrislee 15:06, 22 March 2008 (UTC)
 * Looks like it is the backslashes in windows which are forward slashes on *nix that are not accounted for in the regular expression. The preg replace would need to be something like

$this->baseUrl = preg_replace('|^.+(?=\\extensions)|',$wgScriptPath,$this->baseDir);
 * to work --Zven 21:56, 22 March 2008 (UTC)

what works for me is the following, slash-agnostic line, not verified on *nix though (--Dannyh 22:06, 25 March 2008 (UTC)): $this->baseUrl = preg_replace('|^.+(?=extensions)|',"$wgScriptPath/",$this->baseDir); I have the same problem, but all of the above workarounds produce an "unterminated string literal" error on the page at this line in the rendered html: for (i in tree.icon) tree.icon[i] = 'D:\Web Applications\DevWiki\extensions\TreeView5\'+tree.icon[i]; Any ideas? --Snuck 02:18, 28 March 2008 (UTC)

OK, by fiddling with our $wgScriptPath, and utilising Zven's solution, dTree.js now loads via <script type="text/javascript" src="/extensions\TreeView5/dtree.js"> and the expand/collapse behaviour now works, but none of the images display. I believe the problem is still with this line in the rendered html: for (i in tree.icon) tree.icon[i] = '/extensions\TreeView5/'+tree.icon[i]; The images are in --Snuck 04:52, 28 March 2008 (UTC)

The only way I could get it to work with the images loading was to change line 70 from $wgOut->addScript("<script type=\"$wgJsMimeType\" src=\"{$this->baseUrl}/dtree.js\"> \n"); to $wgOut->addScript("<script type=\"$wgJsMimeType\" src=\"/extensions/TreeView5/dtree.js\"> \n"); i.e., by hard-coding my baseUrl; otherwise, it is output as The rest of TreeView5.php is as per the OrganicDesign site; i.e., without using any of the above workarounds. This makes no sense to me - it appears that  set in line 57 has a different value when it is used in line 70 from when it is used again in line 181, but I can't see anywhere where its value could be changed. I'll keep looking... --Snuck 00:30, 31 March 2008 (UTC)
 * I suggest another approach (which I haven't tested),  is the problem because it contains a windows path with backslashes instead of forward slashes, and on windows they can be either (http://nz2.php.net/manual/en/function.dirname.php). If you convert these to forward slashes before   (approximately line 59) then the path will be constructed like a unix path.

So change the block to

Any feedback on whether this works would be useful. --Zven 00:50, 3 April 2008 (UTC)

I had the problem and it's ok now. Thank you very much. --Teriblus 08:27, 14 April 2008 (UTC)
 * This problem should be fixed in version 5.1.10 --Nad 23:01, 14 April 2008 (UTC)

Experienced the same problem, even when using 5.1.10. Images were not loading, pointing to broken URL when loading: http://mydomain:8080/wikiextensionsTreeview5/img/base.gif

added the baseDir fix above and it works now, points to: http://mydomain:8080/wiki/extensions/Treeview5/img/base.gif --Fpsaceo 14:16, 22 April 2008 (UTC)

Category tree
Hi, Is it possible to mix this extension with the category tree extension ? --Teriblus 08:33, 14 April 2008 (UTC)
 * You can achieve similar results by combining treeview with DPL, see http://semeb.com/dpldemo/index.php?title=Treeview_extension --Nad 22:42, 14 April 2008 (UTC)

No custom icons in 5.1.10
Hi, it seems it's not possible to specify custom icons for single elements in the list. going through the code, it seems that this is not implemented (at least there is no call to method add with a custom icon set). Line 157 would need to be extended to add an icon if needed. will try to investigate this. Jhf2442 21:16, 19 April 2008 (UTC)

„“== Entire site reduced to blank page!!! ==

Current configuration:


 * MediaWiki:1.12alpha
 * php:5.2.3 (cgi-fcgi)
 * MySQL:5.0.27-log

I have downloaded and install all of the latest files but everytime in include the extension on my site I get a blank page. I comment out the 'require_once' line and all returns to normal. I've checked everything I can think of.

Help Please.......

Just restart your machine and clean the cache if possible before restarting.

Blank page after updating treeview5
I updated to latest treeview5 and now my site goes blank. Didn't happen with older versions of treeview5.

--Apap 19:46, 11 May 2008 (UTC)
 * What version of TV5 were you on when it was working? also TV5 is now replaced by TreeAndMenu but I haven't had time to redirect this page and update notes etc. --Nad 21:34, 11 May 2008 (UTC)
 * I was using version 5.1.9. However, I also made an attempted upgrade to mw 1.12 (without updating tables) and then went back to 1.11.2 so I don't know if something went wrong in the process. Unfortunately, I did not save treeview5 ver5.1.9 to check if it works ok. Can I try TreeAndMenu.php? Thanks --Apap 21:49, 11 May 2008 (UTC)
 * I tried TreeAndMenu.php (replacing Treeview5.php but retaining the old name) and it resolves the blank page problem. --Apap 23:37, 11 May 2008 (UTC)

Putting treeview in different place in sidebar
I used the example on the page, problem is I don't want it to go under the toolbox. I want my NavTree to be inplace of the current bullets navigation thing, above my searchbar and I just can't figure it out.

-141.157.90.165 05:44, 14 May 2008 (UTC)
 * You'll probably need to edit your skin file for that, see Manual:Interface/Sidebar for more detail --Nad 10:58, 14 May 2008 (UTC)


 * This worked great, thanks. Results are at http://www.kill-hannah.com. I'm going to try to arrange the text within the tree a little differently, sorta like you have it on organic design.


 * -141.157.90.165 19:35, 15 May 2008 (UTC)

Small comment, for a large tree you can't entirely control the space it takes up, in this case it is quite convenient to put it in the toolbox location. From memory you can enclose the tree in a; [your tree parser function syntax] However you don't want the nodenames to be to long or they get clipped... --78.49.107.231 23:24, 17 May 2008 (UTC)

How to hide navigation box: treeview tied to navigation box???
With Mediawiki 1.13, I have tried to hide the navigation box, or at least set it below the navigation tree.

But NavTree display seems to be tied to the navigation box: whether I try to remove the navigation box from monobook.php or monobook.css, NavTree keeps vanishing.

Any idea how to proceed to solve this? Thanks in advance.

Pb: different styles if logged in or not
With Mediawiki 1.13 / Monobook, The style I chose for NavTree only applies after I log in.

Though I have not set up any CSS rule of that kind, only the lines indicated on the extension main page.

Any idea how to proceed to solve this? Thanks in advance.
 * I'm seeing the same exact problem. I implemented the menu on the sidebar and it's fully expanded without any css applied when users are logged out, but works fine when people are logged in. --Gkullberg 15:20, 3 September 2009 (UTC)

Add more than one tree to article?
I am using mediawiki 1.12 on a windows server and there it does not seem to be possible to add more than one tree to one article. The first one gets displayed correctly, but the other ones are empty. Is there any chance to make this work? -- Markus
 * Looks like a bug has crept in somewhere there, I'll get that fixed as soon as I can --Nad 21:26, 14 May 2008 (UTC)
 * Ok problem should be fixed, try version 1.0.1 --Nad 22:14, 14 May 2008 (UTC)
 * Works, Thanks. -- Markus

Not being displayed in Sidebar
Hi. I installed the TreeAndMenu extension and it works on a normal page but when I edit MediaWiki:Sidebar it doesnt show up on the left side. BTW: I did not modify any css (currently no folder icons are displayed but that is not so important) and to test it I switched to monobook skin using preferences in the wiki interface. I use MediaWiki 1.9.3. When I add $wgHooks['MonoBookTemplateToolboxEnd'][] = '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 '&lt;/ul>&lt;/div>'.$out->getText; return true; } under the include and I edit the page NavTree I get a tree view under the toolbox but I like to edit the navigation box

Can anybody help me?


 * Ok I found out somebody posted that issue before but I didnt know that I have to edit the skin's php code like said in Wikitext in side bar
 * Thanks anyways
 * Just for those who want to have the same like I was looking for (a tree view in navigation): you dont need the function wfNavTree. Only Wikitext in side bar. 

No tree displayed on page
Used Versions : WindowXP SP2 Mediawiki : 1.12.0 PHP : 5.2.5 MySQL : 5.0.51a TreeAndMenu 1.01

Created page with #tree and #menu

Menu work fine but Tree give an fire fox error console "dTree not defined" Is it possible to have a problem of antislash (\) on different path All modifications or suggestions given in this talk dont work

Note : no tree displayed in sidebar of course

Can anybody help me ? Claude Gillet 20 May 2008
 * It's most likely that the dTree javascript isn't loading. Look at the source of the page and check the path its trying to load dTree.js from. If the site is available on the net let me know the URL and I'll have a look. --Nad 00:03, 21 May 2008 (UTC)

I have pretty much the same problem - I installed it new and nothing is happening...www.goerasmus.eu - I used the standard folders. Thanks! --Jorgusch 13:21, 7 June 2008 (UTC)
 * You haven't added the dTree CSS rules --Nad 20:52, 7 June 2008 (UTC)


 * Thanks for quick response! I am completely new and seriously: I cannot find common.css..the MediaWiki article does not say it either..do you have to create it?? Secondly, you say in the description: 'The style of trees can also be configured purely'- this is a bit irritating. Maybe add to the installation chapter that the standard is defined by adding the code. It seems, I am not the first one not getting it. Thanks! --Jorgusch 14:11, 8 June 2008 (UTC)
 * What version of MediaWiki are you running? version prior to 1.10 used the name of their skin for their CSS article, for example MediaWiki:Monobook.css instead of MediaWiki:Common.css. --Nad 06:37, 10 June 2008 (UTC)
 * I am using 1.12 - I downloaded the package again to check whether I deleted it accidently. What I can find under skins\, respectively skins\common is common_rtl.css and commonPrint.css - that's it. Thanks. --Jorgusch 15:52, 10 June 2008 (UTC)
 * Heureka! wiki is too good..I always thought reading the manual 'modify wiki page MediaWiki:Sidebar' is limited to the mediawiki page, as it appears in the URL..no, it is easier…everything is fine - thanks for the great extension!--Jorgusch 23:33, 11 June 2008 (UTC)

Same problem

 * Hi Nad.
 * I have the same problem. Please see the pictures:




 * My Environment
 * MediaWiki: 1.12.0 (The result in the MW 1.11.0 was the same before I upgraded MW to 1.12.0)
 * Win XP
 * TreeAndMenu 1.0.4, 2008-06-08
 * The AppServ Open Project - 2.5.7 for Windows
 * Apache Web Server Version 2.2.3
 * PHP Script Language Version 5.1.6


 * If you want to know my CSS and javascript setting you may see CSS page and javascript page. --Roc michael 23:16, 7 June 2008 (UTC)
 * Hi Michael, sorry for the delay I didn't notice your post here :-/ That looks like more than a JS problem, can you give me the html source of the problematic page? also your localsettings for treeview would be useful too. --Nad 00:53, 12 June 2008 (UTC)
 * Hi Nad,
 * Thank you for your response. Please see my Localsetting.php and I am finding a way to make my wiki can be accessed by public (now, it can only be accessed by localhost).--Roc michael 15:00, 12 June 2008 (UTC)
 * Try commenting out the entries which set $wgTreeViewImages to see if its working with the defaults that come with dTree. --Nad 22:50, 13 June 2008 (UTC)
 * I think this has been fixed on rev:52471. Shinjiman 18:02, 26 June 2009 (UTC)

Multiple trees failing
Hi Nad A first, thanks very much for your job. To have a good running with this extension i have made a modification in Treeandmenu.php file  because the variable baseurl was not correctly evaluated (i m not a spécialiste but i have seen this in html source code generated). My wiki site is not available because internal factory site (Converteam factory). Please help my because my modification is not standard. More, i have another problem : it is impossible to have several tree on the same page (or/and on sidebar). Finally, is there a solution to place the tree anywhere in the sidbar ? Thanks to reply. CGT 01/06/08
 * What you want is a way to overide the property for the instance of the TreeandMenu class from something you put in the LocalSettings.php without having to hardcode anything into the extension itself, this gives your code independence of any further developments.


 * More than one tree can be added to an article at any time, the code automatically allows this, there is an option id= which if specified makes the trees current state persistent sing cookies, to test this, open up two browser tabs of the same article with a persistent tree on it, modify the state of the tree on one article, then reload the other articles in the other tab --Zven 23:32, 31 May 2008 (UTC)


 * Thanks for your quick answer. Unfortunately, my poor english dont permit me to understand all very well.
 * So at first, is my modification on baseurl valid ? and why the original code dont work in my configuration
 * Second how i use exactly the "id" option because my test dont work (same id for all tree ...)give me an exemple please
 * for the place of the tree on the sidebar i must test again relatively to talk above
 * Thanks verry much CGT 01/06/08
 * Not sure what the problem is with your localhost setup, there appears to be a mistake in your code  should have been   ://....

However thebaseUrl variable is a relative path to the treeview directory, not an absolute path; The id option jsut adds a unique tag to the GUIDs for each tree. See my working example, making two windows of the same article, then manipulating one and pdating the other using browser refresh should update the other. --Zven 00:51, 1 June 2008 (UTC)

Hi Nad, Zven I confirme that in my configuration, it is impossible to have more than one tree in article. In detail, the render of the first tree is OK but not for the second (no tree). Effectively, the generated HTML code is not correct (only one tree appear. In fact it is more complicated. The behaviour is very courious. The second tree work well until i add an item in the first tree (the second tree disappear!). The same thing with three tree, the add of one item in the first tree disappear the second but not the third. In your opinion, is it a problem with my configuration (or utilization) or a bug in treeandmenu ? Note : your exemple in organicdesign don't use more than one tree. Have a concret exemple with several tree ? Note : my error console indicate and

Please can you help me because the use of treeandmenu is fundamental for me. Claude Gillet 04 june 2008
 * Can you give me a URL of the site? if if not public, add the wikitext source and the html source of the problem page to my talk page and I'll take a look --Nad 13:14, 4 June 2008 (UTC)
 * Ok I've found the problem, update from SVN and your multiple trees should be working now --Nad 01:21, 5 June 2008 (UTC)

Hi Nad

Thanks for your reactivity. The Multi tree work now well but : is always in my error console
 * it is impossible to use the option (root=, id=, ...) because trees disappear
 * The message

In exchange to your work, i propose to complete the extension documentation to have more explanations for the newby

Regards. CGT 05/06/08
 * I'm not getting that problem on any of my wiki's, can you give me the html source of the page giving such notices? --Nad 00:47, 12 June 2008 (UTC)

I got the same problem with having no images @ TreeView while menus were working great. The problem was that the string containg image directory was worng ("\" instead of "/"). So open the TreeAndMenu.php and add "$this->baseDir = preg_replace('|\\\|', "/", $this->baseDir);" AFTER the exsisting content: "$this->baseDir = dirname(__FILE__);"

Customizing width and position
Hi. Thanks for your work. Question: Are there parameters like width so I can pass in the template a different width according to the particular tree? This is relevant for example if your tree is on the right part of the page. And same for position? - 22.05.08
 * Give your tree an id parameter and then you can address it specifically in your CSS --Nad 21:14, 22 May 2008 (UTC)
 * Hi, what exactly do you mean with a different tree id and address it in CSS? I'm sorry, but i am not too skillful in CSS. Tks - Diego

Customizing the root
Hi. I could not find a way to add a mediawiki link in the top root? Like

Thanks - 22.05.08
 * bug fixed, root parsed as wikitext properly now --Nad 13:58, 4 June 2008 (UTC)


 * Thanks Nad. However in my case it breaks the tree (I have tidy enabled); with a wiki link I see in the source

tree.add(0,-1,'<a href=\"/Test\" title=\"Test\">Test</a>     &lt;!-- Tidy found serious XHTML errors --&gt;      ');
 * Same error w/o a link in the root

tree.add(0,-1,'Test     &lt;!-- Tidy found serious XHTML errors --&gt;      ');
 * Regards, JdV 08.06.08
 * My bad :-/ I should be surrounding my JS script in CDATA and comment syntax, try the latest version which shouldn't have anything "untidy" in it... --Nad 06:26, 8 June 2008 (UTC)
 * Thanks Nad. I still get the same error message though. The tree will only be displayed if I leave the root blank (root=|). Could it be that an EOL or another funny character is in at the end of $args['root']? How does your source code looks (w/o tidy?)? Do you also have a break after the link|plain name and before the string closing? Regards, JdV 08.06.08
 * Maybe I should add, I am on MW 1.11. Thanks, JdV
 * I've fixed the problem, but have temporarily lost commit access so I can't update the changes on the SVN. If you'd like to add the patch yourself, go to the block of code that has the line $p = clone $parser (just search for clone), and replace that block with this one:


 * Nad, Per.fect. Both cases, with or w/o mediawiki markup, work now. A BIG THANKS!!!. JdV 17.06.08
 * No problem :) glad to hear it worked - I got my commit access sorted out, so its up to date on svn now too. --Nad 06:16, 18 June 2008 (UTC)

Remove the root
How can I remove the "root line" and icon completely as in the example on the DPL website?
 * Set the root image to nothing in your localsettings, $wgTreeViewImages['root'] = "" --Nad 22:04, 3 June 2008 (UTC)

I set the root image to nothing like said above. But instead of removing completely there are an icon with a red 'X' in it. How can I remove this icon? I hope, someone can help me.
 * In addition to Nad's suggestion, you could also add a conditional to the dtree.js file:

Find: str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />'; Replace with: //Hiding root node if empty (removing the image gracefully if not set via:       //$wgTreeViewImages['root'] = "";

if (node.icon != ""){ str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />'; }
 * This will avoid the image error icon (tested with FF3, IE8 and MW 1.16). This works for my purposes, I have not tested with all the possible reconfigurations of this extension.  -Cedarrapidsboy 20:50, 17 June 2010 (UTC)

Special pages in toolbox broken
I installed TreeAndMenu and the trees and menus are rendering fine but now when I click on "Special pages" in the toolbox I get the following error message:

Fatal error: Cannot redeclare wfsetuptreeandmenu (previously declared in /var/www/wiki/extensions/TreeAndMenu/TreeAndMenu.php:259) in /var/www/wiki/extensions/TreeAndMenu/TreeAndMenu.php on line 261

Can you help?
 * Are you sure you haven't done the include of the tree from more than one place? does your site have a public URL I can see it from? --Nad 06:38, 10 June 2008 (UTC)

Long Tree Items
Hi Nad. I have a few trees working now, Thanks. The new one contains long item names which I can't change; FAQ questions. Even after adapting them to a "short" name, they would take maybe two or three 250px lines. Any ideas how I can render them in the tree? Thanks - JdV 18.06.08
 * Sorry I can't see a simple way of allowing multiple lines currently, I've had this problem as well and haven't found a practical solution yet. --Nad 23:16, 18 June 2008 (UTC)
 * Hi; any news on this? I was asked by a friend to help her setting a page with a menu and she has many longer items which we cannot figure out how to shorten them. I tried some tricks to create a new line without the icon image but I was not successful... Many thanks - JdV 06.11.08

Versions:

 * MediaWiki 1.12.0
 * PHP 5.2.5 (apache2handler)
 * MySQL 5.0.45-community-nt
 * TreeAndMenu (Version 1.0.6, 2008-06-25)

Source code in Internetexplorer 7
<script type="text/javascript">/*<![CDATA[*/ // TreeAndMenu1.0.6, 2008-06-25 tree = new dTree('tam486d2bb0aa833'); for (i in tree.icon) tree.icon[i] = '/mediawiki/extensions/TreeAndMenu//'+tree.icon[i]; tree.config.useLines = false; tree.add(0,-1,''); tam486d2bb0aa833 = tree; tam486d2bb0aa833.add(1, 0, 'Root1'); tam486d2bb0aa833.add(2, 1, 'Sub-item'); tam486d2bb0aa833.add(3, 1, 'Another sub-item'); tam486d2bb0aa833.add(4, 0, 'Root2'); tam486d2bb0aa833.add(5, 4, 'Sub-item'); tam486d2bb0aa833.add(6, 4, 'Another sub-item'); document.getElementById('486d2bb0aa833').innerHTML = tam486d2bb0aa833.toString; /*]]>*/ http://localhost/mediawiki/extensions/TreeAndMenu//img/folder.gif
 * (Ver 7.0.5730.13 WIN XP SP3)
 * which gives a complete and functional satisfying tree, in stead of "//" before "img" included within the path, tree including images and text is operating

Source code as rendered by Firefox 3
<script type="text/javascript">/*<![CDATA[*/ // TreeAndMenu1.0.6, 2008-06-25 tree = new dTree('tam486d293230452'); for (i in tree.icon) tree.icon[i] = 'http/localhost/mediawiki/extensions/TreeAndMenu/'+tree.icon[i]; tree.config.useLines = false; tree.add(0,-1,'Organic Design'); tam486d293230452 = tree; tam486d293230452.add(1, 0, 'Root'); tam486d293230452.add(2, 1, 'Sub-item'); tam486d293230452.add(3, 1, 'Another sub-item'); document.getElementById('486d293230452').innerHTML = tam486d293230452.toString; /*]]>*/ http/localhost/mediawiki/extensions/TreeAndMenu/img/folder.gif
 * (Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9) Gecko/2008052906 Firefox/3.0)
 * which includes a not working image path, finally nothing is shown, no images, no text, no tree
 * possibly bevcause of  http/local....  in stead of  http://local... 

Solution
??? Please advice how to proceed or where I made a mistake. Thank you.
 * The problem is definitely the "http/localhost", what are your LocalSettings tree config entries? --Nad 21:23, 3 July 2008 (UTC)

I did not know about "LocalSettings tree config entries", I just followed the installation instruction and added the one line info localsettings

actual workaround:

1.) Added into LocalSettings.php (additionally towards the installation described above)

2.) Added into TreeAndMenu.php after the line (app. 65)

thus corrupting your intended regular expression, but actually this leads towards the intended results

Menu working but not the Tree View !!
I have unzipped the contents to the Extensions folder. which has under D:\xampp\htdocs\mwiki\extensions\TreeAndMenu, now i have
 * the img folder
 * TreeandMenu.php
 * dscript.js
 * Extensions.php

I have added dtree.js and css contents to mediawiki:Common.js & mediawiki:Common.css. Then in Local settings i have: require_once("$IP/extensions/TreeAndMenu/TreeAndMenu.php"); $wgTreeViewImages = "http://localhost/mediawiki/extensions/TreeAndMenu/img"; $wgHooks['MonoBookTemplateToolboxEnd'][] = '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> '.$out->getText; return true; }

can any one guide me where i went wrong ?? ---Yantra 74 19:49, 5 July 2008 (UTC)
 * Please supply more information about the problem, what is it doing wrong? is it online? if not I'll need to see the html source code of a page with an incorrect tree in it. --Nad 12:16, 18 July 2008 (UTC)

Reply
This problem haunts also me since previous versions of this extension. I found a fix http://www.mediawiki.org/wiki/Extension_talk:Tree_view#TreeView_not_rendering_at_all --78.84.40.40 14:13, 4 December 2008 (UTC)

Links Break Tree
I am having same issue as Ben above. Tree renders correctly if no brackets (links) are included. At save }} are being inserted before the brackets. After save, text from the first link backwards appears as }} or as a link and then a }}
 * I am using MW 1.12, Opera, Ubuntu Linux. Installed extensions are AutoLink, Cite, FCKeditor (but this issue appears even if I disable FCKeditor), HeaderTabs, HTMLets, ReplaceText, Semantic Forms, SemanticMediawWiki, TreeAndMenu, FaviconLink. I downloaded the latest version of extension today.


 * Solved: Apparently caused by AutoLink extension (using version 2.3 by Virgil Green). I resolved it by adding:

"", to the AutoLink.php file under the lines autoLinkWords array (

Implementation of openlevels parameter
I really needed the openlevels parameter to work for a tree. So, here is my implementation. It is working fine on my MediaWiki 1.12.0. The differences shown below is with respect to TreeAndMenu version 1.0.6, 2008-06-25.

diff -r TreeAndMenuR36999/TreeAndMenu.php TreeAndMenu/TreeAndMenu.php 180a181 >                        $opennodes = array; 189a191 >              $openlevels  = (isset($args['openlevels']) ? $args['openlevels'] : 1) + 1; 194,195c196,201 <              if ($type == 'tree') $nodes .= "$objid.add($node, $parent, '$item');\n"; <              else { --- >              if ($type == 'tree') { >                                        $nodes .= "$objid.add($node, $parent, '$item');\n"; >                                        if (($depth > 0) && ($openlevels > $depth)) { >                                            $opennodes[] = $parent; >                                        } >               } else { 219a226,229 >                                                $opennodesjs = ''; >                                                foreach (array_unique($opennodes) as $value) { >                                                    $opennodesjs .= "$objid.o($value);\n"; >                                                } 229a240 > $opennodesjs Andrea 23:38, 29 July 2008 (UTC)
 * Awesome, thanks a lot! I've been wanting that functionality for ages but haven't had the time to check it out. I've modified the patch slightly and updated it on svn. --Nad 00:19, 31 July 2008 (UTC)

Beginners Problems
I use

on a Windows 2003 sp1

MediaWiki 1.13.0 PHP 5.1.2 (isapi) MySQL 5.0.51a-community-nt-log

Parser-Hooks TreeAndMenu (Version 1.0.7, 2008-07-31) monobook - skin

Major Problem A (Treeview .. no icons...
At first i created a new page where i put

but there are no icons shown... the reason is that the path to the icon ... there are not slashes

Major Problem B (... escape characters in the link... )
if I use menu

the link look like %22/wiki2/index.php?title=test:OffenePunkte&action=edit&redlink=1\" on the front there is a %22 and on the End there is a \"

in the html source there is the following

== > Solution

before this line $nodes .= "$item";

Insert

$item = str_replace("\\","",$item);

Major Problem c
i tried to want to use ... "Adding a treeview to the sidebar (if using monobook skin)"

== > Problem solved http://www.mediawiki.org/wiki/Manual:Interface/Sidebar#Allow_wiki_markup_.28PHP.29

but it didn't work (no treeview)

i also tried to put the treeview .. at the MediaWiki:Sidebar - Page also no treeview... at the sidebar .. but in the mediawiki:sidebar Page

also dynamic tree doesn't work

if I use

only the line is shown!

thx!
 * Did you install the DPL extension? --Nad 11:28, 29 August 2008 (UTC)

Major Problem D (.:. Another problem with escape characters in the link .:. )
if I use menu

the link look like http://192.168.0.2/%22/t3wiki/index.php/T3/%22 "after the direction ip is a %22/ and on the End there is a %22"

in the html source there is the following

<ul class='dmenu' id='4b85512a7984a'> Introducción  <a href=\"/t3wiki/index.php/T3\" title=\"T3\">T3</a></li> T3Wiki</li> </ul></li> Funciones básicas  Ingreso a T3Web</li> Interfaz de usuario T3Win</li> Interfaz de usuario T3Web</li> Notificación de cambios</li> Actualización de T3Win</li> Cambio de contraseña T3Win</li> Cambio de contraseña T3Web</li> Reporte de fallas</li> </ul></li> Modulos  Ventas  Vendedores</li> Zonas de venta</li> Clientes</li> Rutas de visita</li> Pedidos</li> Cuotas de venta</li> Estadísticas de venta</li> Lista de precios</li> Reporte de actividades</li> </ul></li> CxP  Facturas de compra</li> Acumulado de obligaciones</li> Ordenes de pago</li> Emisión de cheques y transferencias</li> Comprobante de retención de IVA</li> Comprobante de retención de ISLR</li> Notas de crédito de CxP</li> Notas de débito de CxP</li> </ul></li> Compras  Proveedores</li> Ordenes de compra</li> Notas de recepción</li> Proveedores</li> Ordenes de compra</li> Notas de recepción</li> </ul></li> Almacén y despacho  Productos</li> Inventario</li> Ajuste de entrada</li> Ajuste de salida</li> </ul></li> Crédito <ul> Guía de transporte</li> Relaciones de cobranza</li> Cheques</li> Notas de crédito de CxC</li> Notas de débito de CxC</li> Facturas de venta</li> Traslado de documentos de CxC</li> Devoluciones de venta</li> Cierre de caja</li> </ul></li> Banco <ul> Control de chequeras</li> Conciliación bancaria</li> </ul></li> Contabilidad <ul> Plan de cuentas</li> Comprobantes contables</li> Cierre de mes contable</li> </ul></li></ul></li></ul>

Saving tree status between page transitions
Is there a way to save the status of the tree to save the current leaf unfolded, instead of the tree folding everytime the user clicks a link?
 * Yes, just add an id parameter to your tree so that it can be uniquely identified --Nad 06:03, 5 November 2008 (UTC)

I would like to do this too - where does the id parameter go? I tried adding one to the NavTree page and it didn't do anything other than breaking the tree functionality. Do you need 1.08 to do this? We're running 1.07 (but the guy who's working with me will upgrade us to 1.08). Have looked for clear instructions on how to implement persistence to no avail. Thanks! VIngogly 15:41, 19 December 2008 (UTC)
 * See the usage section, I've added an example id to the last example --Nad 20:00, 14 January 2009 (UTC)

Don't include <tt>id=</tt> in transcluded sub-trees
I've noticed trees won't render if they have transcluded sub-trees that contain their own <tt>id=</tt> clause. The documentation doesn't make mention of that, so I thought I'd share. --Jeffreykennedy 19:53, 18 November 2008 (UTC)
 * Thanks I'll look in to that soon --Nad 19:59, 14 January 2009 (UTC)

Not JS output
i've installed this extension correctly:

MediaWiki 	1.12.0, PHP 	5.2.0-8+etch13 (apache2handler), MySQL 	5.0.32-Debian_7etch8-log

but this is the output of:

1tam494bdf426eeec494bdf42846b20Root12tam494bdf426eeec

1tam494bdf426eeec494bdf42846b21Sub-item2tam494bdf426eeec

1tam494bdf426eeec494bdf42846b21Another sub-item2tam494bdf426eeec

1tam494bdf426eeec494bdf42846b20Root22tam494bdf426eeec

1tam494bdf426eeec494bdf42846b21Sub-item2tam494bdf426eeec

1tam494bdf426eeec494bdf42846b21Another sub-item2tam494bdf426eeec

P.S.:

zend.ze1_compatibility_mode	Off	Off

so not the same problem like # 4 Treeview suddenly stopped working in Navbar

P.S.S.: ok, the error occurs because i've installed this extension: Extension:Edit_Section_Link_Transform

? 77.21.174.72 18:06, 19 December 2008 (UTC)

dynamic drop-down menu
Hi, I integrated the dynamic drop-down menu into the sidebar on the left side, but now I added submenus and of course I can't see them because the sidebar is too small. I dont't like to expand the width of the sidebar, but I don't know how I could overlay the submenu without expanding the width from the sidebar. Is it possible? - --Ulli 757 22:11, 11 January 2009 (UTC)
 * I find the menus go over the top of everything else on most skins including monobook (see example pic below) - what skin do you have? you'll need to fix the problem by modifying the menu's css rules. --Nad 19:55, 14 January 2009 (UTC)


 * Thank you very much Nad - your image shows that my problem is solvable and it encourages me to continue the enhancements of my css-knowledges (I use monobook skin) - best regards --Ulli 757 22:24, 15 January 2009 (UTC)
 * in the meantime I detected that it works with IE7, it doesn't work with firefox 3.... --Ulli 757 17:54, 16 January 2009 (UTC)
 * Try starting with the CSS shown at Extension:TreeAndMenu since thats known to work on both IE and FF, then adjust the design elements bit by bit so you revert any change that breaks it. Also we have a working example which works in both browsers at OrganicDesign:Extension talk:TreeAndMenu.php which also shows its CSS rules. --Nad 10:39, 18 January 2009 (UTC)
 * I have the same result with the example from OrganicDesign, it's only a problem with ff 3 (it works in ff 3 if I use the exemple in a page). It seems to me z-index doesn't work as I expect using it on sidebar. I will google if there are some problems with z-index and ff3 - kind regards --Ulli 757 23:19, 20 January 2009 (UTC)
 * How did you end up integrating the dynamic menu into the sidebar? --Gkullberg 13:42, 3 August 2009 (UTC)
 * 1. download the snapshot-version, 2. put the code into the ../extension/TreeAndMenu-folder, 3. add the "include"-line to LocalSettings.php, 4. add the hack ($wgHooks ...return true;} (see description on this extension front page) to LocalSettings.php after the "include"-line, 5. put alle the CSS-Code shown on the exetnsion page to the Mediawiki page "MediaWiki:Common.css", 6. write on the MediaWiki page "MediaWiki:NavTree" the following code:  (the stars beginning in col 1), 7. works in IE, not in FF 3 (I don't yet know the reason) Kappa 15:44, 5 August 2009 (UTC))

Problems configuring the extension
Hello, i don't know if this is the right place to ask this but i don't know someone else to ask too, I've followed the instructions from here http://www.mediawiki.org/wiki/Extension:Treeview but it still does not work for me, the tree appears like a nested list and this line {{#tree appears just like a static text (i did changed my MediaWiki:Common.css article. Can you help me to configure this? I really need this to work because it is very helpfully to me,

Thank you very much
 * If you're seeing the #tree symbol then it sounds like the extension's not installed, go to your Special:Version page and see if TreeAndMenu is in the list of installed extensions. Also, it would help to know what version of MediaWiki you're running. --nad 08:27, 21 January 2009 (NZDT)

in Special:Version is only this: ''Product 	Version MediaWiki 	1.13.3 PHP 	5.2.6 (apache2handler) MySQL 	5.0.51b-community-nt-log''

but in my LocalSettings.php file i have include("$IP/extensions/TreeAndMenu/TreeAndMenu.php"); (i also tried with include("extensions/TreeAndMenu/TreeAndMenu.php"); ) and no result. I've tried also with MediaWiki version 1.12.0

Thanks for helping me
 * Specifically you need to see if the TreeAndMenu extension show up in that Special:Version page, if its not showing up in there then you haven't done the correct include statement in your LocalSettings.php file. --nad 12:25, 21 January 2009 (NZDT)

Now i can see the TreeAndMenu in the Special:Version but i can't use the tree; i can use the menu but if i edit the main page and enter the lines {{#tree: }} nothing appears (i did edit the articl http://localhost/wiki/index.php/MediaWiki:Common.css), not even a nested list; what can i do?
 * Root1
 * Sub-item
 * Another sub-item
 * Root2
 * Sub-item
 * Another sub-item

Thanks


 * what did you "edit" in the MediaWiki:Common.css (Finally, add the CSS stylesheet to your installation by modifying/creating your MediaWiki:Common.css article (note that's an article not a file). Otherwise, your menu will look just like a nested list.) also check out this article on cache issues... --phalseid 04:00, 22 January 2009 (NZDT)


 * Try looking at the html source of your page with the tree and see what it's outputting, probably the image paths are incorrect making it zero-size or somehting. --Nad 20:25, 21 January 2009 (UTC)

Tree is not displayed
The tree is not displayed, only the menu; The errors from the Firefox console are:

1)Error: dTree is not defined -in the html code i have something like this <script type="text/javascript" src="/wiki\extensions\TreeAndMenu/dtree.js"> and i think there is something wrong with the path; what should i do to automatically get the right path (/wiki/extensions/TreeAndMenu/dtree.js) - there is a \ instead /

2)Warning: Error in parsing value for property 'display'. Declaration dropped. Source File: http://localhost/wiki/index.php?title=MediaWiki:Common.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000 Line: 179 -here there is a problem with the line display from the block: body div.NavShow {        display: normal; } 

What should i do

Thanks


 * Are you still working on "localhost"? -> quick and dirty solution: try to replace the line 	 $this->baseUrl = preg_replace('|^.+(?=[/\\\\]extensions)|', $wgScriptPath, $this->baseDir); on line ~65 in TreeAndMenu.php through $this->baseUrl = '/yourwikiname/extensions/TreeAndMenu/'; (please don't use this in a production system!!)- --Ulli 757 18:31, 21 January 2009 (UTC)

This is working partially, the links appears but no images is loaded (the computer, folder... icons) and the links from the root are not 'tabbed', their positions it is just bellow the root

I've installed again so now i have http://192.168.0.2/wiki but i still have this line in the html code <script type="text/javascript" src="/wiki\extensions\TreeAndMenu/dtree.js"> and it does not load the js file...

I also have in the htlm code this line for (i in tree.icon) tree.icon[i] = '/wiki\extensions\TreeAndMenu/'+tree.icon[i]; I've replaced in the TreeAndMenu.php line 65 with $this->baseUrl = '/wiki/extensions/TreeAndMenu/'; but in the html code only the line <script type="text/javascript" src="/wiki\extensions\TreeAndMenu/dtree.js"> changed but the line with tree.icon[i] still has the wrong path
 * you could set $wgTreeViewImages = "http://localhost/yourwiki/extensions/TreeAndMenu/img"; in LocalSettings.php (just for tests with localhost). Could you please sign your contributions? (with --~ ) on the end? It would be easier to follow the discussion - thanks - --Ulli 757 19:07, 22 January 2009 (UTC)
 * You're having trouble due to the backslashes that windows file paths have, thats why the preg_replace line above is used (which you removed). Javascript doesn't like backslashes in strings. --Nad 19:37, 22 January 2009 (UTC)
 * I just used them temporary (in my windows system :-(, in my production system (linux) I use your original code and this works fine :-) - kind regards --Ulli 757 20:20, 22 January 2009 (UTC)

dTree.js path incorrect
Hello,

Tried to get TreeAndMenu in today but found a potential problem with it. The extension tries to include it's javascript and it uses a full path to do so which is incorrect for my server e.g.

<script type="text/javascript" src="/home/blah/web/htdocs/mediawiki/extensions/TreeAndMenu/dtree.js">

it should be just

<script type="text/javascript" src="/mediawiki/extensions/TreeAndMenu/dtree.js">

The error I believe is on line 64 of TreeAndMenu.php

$this->baseDir = dirname(__FILE__);

Version r44288 of the code grabbed from svn. Regards, Chris --78.105.2.27 19:12, 28 January 2009 (UTC)

Okay it's not that line, I changed the order of line 65 & 66 so it does the str_replace first, noww the path is correct. Linux box btw so no problem with \'s --78.105.2.27 19:19, 28 January 2009 (UTC)


 * I can double that, had to change those two lines to see the treeview and the icons. so now it looks like:

/* Update general tree paths and properties*/ $this->baseDir = dirname(__FILE__); $this->baseUrl = str_replace('\\', '/', $this->baseDir); $this->baseUrl = preg_replace('|^.+(?=[/\\\\]extensions)|', $wgScriptPath, $this->baseDir);


 * We had to change a line below to make it work on Windows machine (Jul 15, 2010):

$this->baseUrl = preg_replace('|^.+(?=/ext)|', $wgScriptPath, $this->baseUrl);

Custom root icon for a single tree
I'd like to use different root icons for trees on my site.

Is it possible to select a special root icon for a single tree?

It would be great to have an option for that like:

Or even better, one can select a full image set for a single tree:

Thanks for replay --Dst 15:54, 2 February 2009 (UTC)

Collapsing trees
Is there a way to collapse a tree to rootname only?

I'd like to display additional information, especially for short descriptions of input fields, on opening the first tree level.

Thanks --Dst 16:35, 2 February 2009 (UTC)

Dynamic openlevels
Hi, if I have the Tree on the sidebar then is it possible to open the level of tree based on the current page opened. So that the users can easily locate their location in the tree.

For example. If I have some thing like this:

and I am on page “sub-sub item3” then the tree on the sidebar should expand up to the level of “sub-sub item3” and the rest (from “Another sub-item” onwards) still remains contracted.

Thanks,

ssaq22 14:55, 9 February 2009

Misformatted URL - Menu View
.../\"/index.php?title=Special:RecentChanges\"

how can i solve this problem? i didn´t find the section within TreeandMenu.php which is responsible for the output


 * Problem is already solved
 * before this line $nodes .= "<li class=\"$class\">$item";
 * Insert
 * $item = str_replace("\\","",$item);

Yup, noobie time again
HI after many days of searching, I think this is deff the right menu for me..I installed it works like a dream... but I would like to add the Menu to my sidebar, I would prefer the Menu, and not the Tree. Could someone point me in the right direction to get this implemented. Thanks in advance, --Satire3rd 18:31, 19 February 2009 (UTC)

Nevermind, I figured it out, now I'm having the same problem Ulli 757...The menu doesnt want to show up on Firefox, or Chrome, IE works fine though. --Satire3rd 18:45, 19 February 2009 (UTC)

dTree undefined
Hey, I know, that this problem has been handled many times before^^ But i can't figure out, why the trees don't display on my machine...

OS: Win Server 2003 MW: 1.14.0 PHP: 5.2.8(apache2handler) Tested Browser: IE7 and Firefox (latest Version) Does someone would like to post the steps, how to solve this problem? menu works fine(thanks to all little helpers;)) but tree-space is empty. IE and FF error message: dTree is undefined. they should show up at the main page; not in the sidebar. Tried the solutions from above but they don't work for me...

Thanks in advance!



--freezone 15:39, 30 March 2009 (UTC)

Notice: Undefined offset: ... line 209
I'm getting an error printed when using the #menu mode. The menu displays fine but the error prints at the top of every page that displays a menu. Notice: Undefined offset: 8 in /var/www/html/extensions/TreeAndMenu/TreeAndMenu.php on line 209 I first tried the 1.14 snapshot then the Development snapshot to no avail. In addition, #tree mode doesn't display anything at all for some reason.


 * UPDATE
 * This issue is only occuring when using DPS for dynamic menu's
 * Code that causes issue:

If no one else has seen this problem then just ignore / delete this post.--Zinthose 22:39, 6 April 2009 (UTC)


 * I've got the same issue (MediaWiki 1.15.3, TreeAndMenu 1.1.1, DynamicPageList 1.8.9) : my NavTree based on DPL and TreeAndMenu extensions doesn't work anymore (see Creating Category Trees with DPL extension). I'm getting the same error (Notice: Undefined offset: 1 in [...]\extensions\TreeAndMenu\TreeAndMenu.php  on line 201).  Can someone help ? --Megajoule 20:49, 7 June 2010 (UTC)

Page Size Bloated with TreeAndMenu
TreeAndMenu seems to load each image used in the tree (folder, page, root icons, etc.) from the webserver, each time they are used. I'm not sure if this is just how web pages work, or if the browser thinks each image is unique and needs to be loaded again. In any case, after I added my tree to the sidebar, each page in my wiki was now >1MB in size (1100 images are reported as being loaded to support the tree). All of the collapsed nodes, and their content, are included in that image count.

After suffering poor performance for a while, I installed the simplistic Firefox Extended Statusbar. It simply reports (in Firefox) the time it takes to load a page, the size of the page, and how many images were loaded. To my surprise, all of my MediaWiki articles were loading 1100 images! Also, each article was greater-than 1MB!

Sure enough, loading the official Treeview extension page results in an 863KB page with 825 images.

Is there any way we can get our browsers to only load each unique image, once?

I love this extension, so until this is fixed, I will artificially reduce the size/depth of the tree. Thanks! -Cedarrapidsboy 16:14, 20 April 2009 (UTC)
 * That status bar is counting all images even when they're loaded from local cache because if you do a full refresh you see the real time it takes to load everything. The large load size shown includes 100's of KB of CSS and JS as well as images, but those items are only transferred rarely. --Nad 01:28, 21 April 2009 (UTC)
 * Thanks. I'll have to use a more reliable network monitor to see what is actually passing over the wire.  One good thing that came out of this experiment, we removed a bunch of information from our trees that likely was only clutter.  :)  The bad news...  not a silver bullet for our performance issues. --205.175.225.24 12:27, 21 April 2009 (UTC)

Installation
Why not extending the Installation-Chapter with another version "Installation for dummies" (e.g.: me)

I would really appreciate to use the tree but the installation process described is surely not covering 100% of the steps necessary. May be some other requests on this page are produced by this lack of information, too? Finally I did not figure it out. Please someone with a standard virgin mediawiki setup describe a complete list of steps which are to be done to get tree view with symbols as well as within the sidebar. Thank you.
 * no information on what to do with dtree.js
 * no information about path to images and where to set this (if neccessary?)

Images section not helpful
The Images section on the main page is not particularly helpful. I was looking for a discussion on how images work and how you can control them, but the Images section contains nothing other than a bulleted list of something - maybe image names? Unjedai 23:00, 9 June 2009 (UTC)

Last version wrong
The main page lists the Last Version as "1.0.8 (2008-12-08)" but it appears that as of today, 9 June 2009, the Last Version is 1.14. Unjedai 23:00, 9 June 2009 (UTC)
 * Updated to 1.1.0 as current. Shinjiman 17:59, 26 June 2009 (UTC)

Self Node Title Disappearing on load
I have this installed and working very nicely. However there is one problem that I cannot seem to figure out. When you click on a node link and load up the page, that node is then omitted from the tree when the reulsting page loads. I checked and the node is actually missing from the page source for the construction of the tree. I am using DPL to dynamically add the subnodes based on a category membership. Any thoughts on why this might be happening? --Bsmithme 01:11, 21 June 2009 (UTC)
 * I just figured out why this was happening and it wasn't due to TreeAndMenu. Since I'm using DPL to create the nodes in the tree, DPL defaults to NOT including the current page in the list. Setting skipthispage=no in DPL solves this. --Bsmithme 03:21, 21 June 2009 (UTC)

Icon look and feel
As currently the icon set are still using the XP theme, is that have a chance to use a newer set of icons by default like Vista 7 theme? And I think there's would be possible to make the mouse hover effect for the +/- icons. :) Shinjiman 17:14, 23 June 2009 (UTC)
 * Just updated on rev:52871, any feedbacks are welcome. Shinjiman 17:59, 26 June 2009 (UTC)

Add Menu to Sidebar?
Adding a tree to the sidebar seems pretty easy. However, is it possible to add a menu to the sidebar? Are there any examples out there? --Gkullberg 18:01, 27 July 2009 (UTC)
 * I figured out how to do this. I followed these instructions: http://www.mediawiki.org/wiki/Manual:Interface/Sidebar#MediaWiki_1.13.2 so that the sidebar allows wiki markup.  Then I could edit MediaWiki:Sidebar and add the tree. --Gkullberg 13:28, 6 August 2009 (UTC)
 * In my MediaWiki 1.15.0 this solution works fine with IE, but it does not work with Firefox 3.0.13. If I change in ../skins/monobook/main.css  ".portlet {overfolw:hidden;}" to ".portlet:overflow:visible;" the Firefox version can be used if further sizes are rearranged and overflow is "controlled" by blanks and line breaks. But in this case the IE version is full of overflows --Kappa 15:45, 6 August 2009 (UTC)
 * Has anyone tried implementing this with the new Vector skin that is part of the Usability Initiative? --Gkullberg 18:40, 7 September 2010 (UTC)

no-script-version
Hi,

I'd like to rebuilt the sidebar as a treeview including everything that is not pagecontent in narrower sense – like Special:MyPage, Special:UserLogout, Categories, etc. But when a user has javascript disabled, the sidebar will be empty at all. Is it possible to add a no-script-version in the way, that the tree is displayed with all folders opened and without "+"/"-"?

Sorry for my lack of English, hope you understand my problem. Greetings --WiMu 10:12, 9 August 2009 (UTC)

StubObject problem
Hi, I'm running:

Windows XP SP3

XAMPP 1.7.2

PHP 5.3.0

I've installed DPL and have been trying to get TreeAndMenu to work for about a week. I keep getting this error: Warning: Parameter 1 to Language::getMagic expected to be a reference, value given in E:\xampp\htdocs\mediawiki\includes\StubObject.php on line 58

I can suppress it by turning error reporting off but it seems that there is something else wrong with TreeAndMenu. The #menu function works, the #tree function doesn't, at all. Furthermore, #dpl syntax doesn't work inside of #menu

The path to dtree.js is a windows path, which was supposed to be fixed in the last revision to TreeAndMenu.php. I am confused. By hardcoding it I have gotten #tree to output something, but it still doesn't work with #dpl syntax (the #dpl syntax just appears like any other text, rather than activating).

Any suggestions are appreciated. I'm at my wits' end and can find no collapsible list extensions for mediawiki that don't throw that warning at me.


 * Hi, I have exactly the same issue, the same message.
 * My config is :
 * MediaWiki 1.15.1
 * PHP 5.3.0 (apache2handler)
 * MySQL 5.1.37-community-log


 * Thanks in advance for your help (your extension is just what I was looking for). B2T2009-09-10


 * it's B2T again . I solved the error display by puting the include at the top of the php file just after the php tag.
 * nevertheless and despite the fact that I tuned my Common.css page, I still don't have any tree :(
 * hhhhheeeelllppp !

Hi, I had the same issue. Besides the fix that B2T suggested of moving the include to the top of the php file, you can do this (Jul 15, 2010):

Find this line in Language.php in the languages folder and change this line:

Original - function getMagic( &$mw ) {

Fixed - function getMagic( $mw ) {

Menu with Submenus shows an Arrow
Is there any way to have the main menus with submenus display an arrow for users to know that there is a submenu?

Thanks

MouseOut Timeout?
Lostpedia has a menu installed on their left nav bar. The nice thing about it is that when you take your mouse off the nav bar there is about a 1/2 second delay before the menu goes away. It seems like there's a small bit of JavaScript controls this. Is there any way to provide the same sort of functionality for TreeAndMenu? --Gkullberg 12:00, 29 October 2009 (UTC)

Conflicts with php 5.3?
hi folks,

are there any known bugs for this ext. running on a webserver with php-versions > 5.3?

I updated my configuration from php 5.28 to 5.3 (centos 5.3, apache 2.2.3) because another app on the webserver need the new php version. After that the extension stopped working and so i tested it in a new environment based on xampp1.7/winxp and it's working as intended.

Thanks in advance

Works with other extensions/templates?
I'm trying to use the TreeAndMenu extension to dynamically display RSS feeds on my wiki. To that end I have installed the SimpleFeed extension as well. I am trying to get them to play nice with eachother so that I can see the feeds' headlines in a tree.

I have the following code on my page:

Code:

Which results in the following output, where "Test" is part of the tree, but the rest is directly after it.

Test

2tam4b68f35c6dbd2

What is going on here? Am I doing something that can't be done? When I have just the Code:

line I can see the headline of the first news item.

Thanks, RotsiserMho 04:04, 3 February 2010 (UTC)

Different view for printable...
I am hoping this has already been done and maybe a simple implementation. Basically I would like when my users goto the printable version of a page they just get a simple UL/OL of what is in the tree instead of the javascript version. Any thoughts?


 * So diving a little further I guess I need some condition to use to tell this extension to not render the tree if we are in print mode. $wgAction is view for both print and regular viewing, what else could I use?

Fix Problems with Alignment
I was having problems with items below the menu butting up against it unpredictably, and as the menu changed size.

I just added <display: inline-block;> to .dmenu{} in the css file(common.css for me)

Tree rendering failure and menu link URL mismatch
Hi, I installed TreeAndMenu for my MediaWiki 1.12 and after reading all the advices on this page I still can't get neither the tree nor the menu working.

1. The tree below doesn't appear at all:

Only the items on the first tree level are rendered to simple links. They appear like


 * Mainpage

NewPage

2. The menu is in fact rendered but the generated link URLs are faulty. The following example generates the URL  http://ourwikidomain/mediawiki/index.php/mytopic/\"/mediawiki/index.php/Mainpage\"  instead of  http://ourwikidomain/mediawiki/index.php/Mainpage  when the menu below is inserted in the page  http://ourwikidomain/mediawiki/index.php/mytopic :

During the preview when editing the file I also get another URL, when I hover the mouse over the link text:  http://ourwikidomain/mediawiki/index.php/\"/mediawiki/index.php/Mainpage\" 

I put here some of my settings and hope somebody will be able to diagnose the failure: LocalSettings.php $wgScriptPath      = "/mediawiki"; TreeAndMenu.php $this->baseUrl = str_replace('\\', '/', $this->baseDir); $this->baseUrl = preg_replace('|^.+(?=[/\\\\]extensions)|', $wgScriptPath, $this->baseDir); $this->baseUrl = '/mediawiki/extensions/TreeAndMenu/';
 * 1) Fix EW:

I'm not experienced in PHP. Could somebody tell me the right settings?

Ewitsolutions 13:22, 29 April 2010 (UTC)

Menu is displayed but Tree is not displayed
I used the TreeandMenu.php to display the tree view. However the treeview was not displayed correctly. I tested with some sample code from Mediawiki. Here is the code.

It displayed a menu but instead of the tree, I got the display as text with bullets. Is there anything I am missing?

Following is the HTML source ouput on firefox.

<ul class='dmenu' id='4c2b8f5de041a'> Root1 <ul> Sub-item</li> Another sub-item</li> </ul></li> Root2 <ul> Sub-item</li> Another sub-item</li> </ul></li></ul> <script type="text/javascript">/*<![CDATA[*/ if (window.attachEvent) { var sfEls = document.getElementById('4c2b8f5de041a').getElementsByTagName('li'); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function { this.className+=' sfhover'; } sfEls[i].onmouseout=function { this.className=this.className.replace(new RegExp(' sfhover *'),''); } } } /*]]>*/

I have the exact same problem as described here (above). I'm running: I've followed the installation instructions and the #menu is parsed and rendered correctly. However #tree is not even detected as a parser function. dTree.js is successfully loaded. If I look at the generated HTML for my page I get the same result av shown above. TreeAndMeny shows up in special pages with correct version. Apache have (at least) read access to all necessary files.
 * TreeAndMenu: Version 1.0.9, 2009-02-15
 * MediaWiki: 1.15.1
 * PHP 5.3.2-1ubuntu4.5 (apache2handler)
 * Host-OS: Ubuntu 10.04
 * Kernel: 2.6.32-22-generic

henrik.thuren 14:06, 29 December 2010 (CET)

Exhausting Memory
When I view my main page while logged out, I get the following error:

<tt>Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 425327 bytes) in /glide/apache/www/wikiuat/extensions/TreeAndMenu/TreeAndMenu.php on line 267</tt>

If I log in and go to the main page, there is no problem. Any reason why logging in/out would affect the behavior? Guy.yedwab 14:27, 1 July 2010 (UTC)

Links not rendering correctly
Something is really bogus about my installation, because if I try to make a link out of a menu item, it does not render correctly. Here is some more information:

When I look in firebug at the link that was generated for Customers, it looks like this:

<a page\="" main="" title="\"Customer" href="\"/wiki/index.php/Customer_Main_Page\"">Customers</a>

All the links are broken in similar fashion. I can't actually use the menu to link to anywhere. I'm using MediaWiki 1.15.4.

One thing that may be relevant is this:

Every other page load (yeah, weird, eh?) I get the following error (I'm using the latest build from subversion, 1.1.1):

Errors: * Notice : Undefined offset: 13 in /var/www/html/wiki-1.15.4/extensions/TreeAndMenu/TreeAndMenu.php (line 214) trace: 1. [internal function]: TreeAndMenu->renderTreeAndMenu( Object(Parser), ' 1tam4c62e34a082dfmainMenu0 <a href="/wiki/i...' )        2. ./includes/Hooks.php (line 117): call_user_func_array( array, array )         3. ./includes/parser/Parser.php (line 411): wfRunHooks( 'ParserAfterTidy', array )         4. ./includes/Article.php (line 3557): Parser->parse( '{{#menu:id=mainMenu|* [[Customer_Main_Page|Custom...', Object(Title), Object(ParserOptions), bool(true), bool(true), 27817 )         5. ./includes/Article.php (line 979): Article->outputWikiText( '{{#menu:id=mainMenu|* [[Customer_Main_Page|Custom...' )         6. ./includes/Wiki.php (line 450): Article->view         7. ./includes/Wiki.php (line 63): MediaWiki->performAction( Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest) )         8. ./index.php (line 116): MediaWiki->initialize( Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest) )

Any thoughts?

TreeAndMenu at Sidebar with Skin Vector?
I installed mediawiki 1.16 with the skin vector and extension TreeAndMenu. On a normal page TreeAndMenu shows up fine, but I did not make it work on left sidebar. I have now add the following code to LocalSettings.php (under the include):

$wgHooks['MonoBookTemplateToolboxEnd'][] = '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 '&lt;/ul>&lt;/div>'.$out->getText; return true; }

This code looks like made for monobook, but I have vector. Any thoughts how to change this code to fit to vector skin? Thanks in Advance.

AddSlashes Breaking URLs
Well i'm only using this for menus. However I found its breaking screwing up URLS Using this for a menu I was simply doing  *SomeCategory  The addslashes is screwing up URLS, removing it fixes the problem. Kilandor 03:03, 19 October 2010 (UTC)