Talk:Tree view

From Organic Design wiki

I am struggling with your installation instructions for Tree View. I inserted the tree-view.php code directly in LocalSetting.php; however, the images do not display and the tree contracts but does not subsequently expand. Please advise.

Can you give me the url to have a look? it's only been tested on 1.6.7, and that's a bit of a weird bug which I have no idea how to fix without seeing it for myself... --Nad 20:59, 7 Mar 2007 (NZST)
Also, have you got the latest code - I was doing a lot of work on it last night to get them to work recursively, maybe you installed it part way through my changes? --Nad 21:01, 7 Mar 2007 (NZST)

Here is the URL, http://www.infonomx8.com/mediawiki/index.php/Treeview; when I inserted the wrapper code in LocalSetting.php, I received an error stating that new Article() constructor could not be instantiated. I removed the entire wrapper code and the yield is what you see at http://www.infonomx8.com/mediawiki/index.php/Treeview. For your second concern: I used the code available within the your article Treeview.php as of today (Houston TX CST 1:00 pm).
Also, concerning the images. I manually setup the directory structure as indicated within your php code and then I uploaded the folders and your images via FrontPage. My directory structure necessitated that I change your /wiki/images... to /mediawiki/images...

There shouldn't be any wrapper code, just an include of the code - and the code should be MediaWiki treeview.php, not tree-view.php which is specific to this wiki. --Nad 21:57, 7 Mar 2007 (NZST)
Your treeview seems to be almost working, the main problems is that the image paths haven't been set properly because in the html source it shows that its still using the default paths, just set the array of images in the line before including the treeview code so it doesn't resort to the defaults. Theer's another problem because the depth attrributes aren't correct, but it'll be easier to see what's going on if the images are working first. --Nad 22:39, 7 Mar 2007 (NZST)
Finally, I have the images appearing and some functionality. http://www.infonomx8.com/mediawiki/index.php/Treeview Thanks for your assistance.
Thank you not only for a fantastic mediawiki extension but also your gracious assistance with the installation and trouble shooting. Check out the final product: http://www.infonomx8.com/mediawiki/index.php/Treeview. Note that your extension works well with the showhide extension (open the first one).
I plan to use your treeview extension very extensively on my three mediawiki sites. As soon as my sites are ready for a grand opening I will notify you. One feature of my web project, which is a immense undertaking, will be to recognize contributors, such as yourself, on the very pages where the contribution occurs. Again, thanks for sharing your craft.
Glad to see you're finding it useful ;-) - but don't put too many trees on there just yet because I'm doing a completely new version which is far more efficient and the recusion (transcluding trees in other trees) works much better with no bugs. But the syntax for using them is slightly different and uses the following syntax:
				{{#tree:
				*foo
				**bar
				**{{sub-tree-1}}
				*baz
				}}

Also struggled

While I appreciate your making this extension available, I also struggled to get it installed. It would have been nice if all the images were available in a single ZIP file (say) and if they lived in a folder UNDER the folder where the treeview.php file is installed, it would have been easier. In fact, I did create such a folder so now I have the following structure.

I'm not really interested in maintaining a bunch of files and zips, I like all the scripts and images to be in the wiki --Nad 08:55, 10 Mar 2007 (NZDT)
While I agree with you in principle, it breaks down in practice when there are multiple images because the wiki doesn't provide a decent mechanism to manage multiple related images in one go. So to use your scheme, one has to upload each image one at a time, then find out where the upload mechanism actually put the files so you can refer to them. DavidJameson 03:16, 13 Mar 2007 (NZDT)
  • wikiroot
    • extensions
      • treeview.php
        • treeviewimages
          • image files


I do however have two issues to resolve:

1) How can I configure the code so that a treeview always starts CLOSED rather than expanded? I'm using the treeview as a cute way to display questions and answers and so I don't want people to see the answers until they explicitly click the open icon.

The id=1 means open to one level by default, just remove the id attribute as I've done to your tree above --Nad 08:52, 10 Mar 2007 (NZDT)
Perfect - thanks DavidJameson 03:16, 13 Mar 2007 (NZDT)
Just curious - is there a reason why that attribute couldn't have been called something like openlevel=1? DavidJameson 03:19, 13 Mar 2007 (NZDT)
Yeah it was because in the original way I had done it the wiki parser was removing unknown attributes so I had to use a legal one. I didn't know you could mark the result as OT_HTML so it would be protected from the parser. I'm doing a much more efficient one now which uses parser-functon syntax instead. --Nad 07:48, 13 Mar 2007 (NZDT)

2) How can I change the extension so that the javascript is only injected into pages where I'm actually USING a treeview as opposed to its current implementation where every single page view now contains all this javascript in it?

I'll do that in the next update if I get round to it --Nad 08:52, 10 Mar 2007 (NZDT)
Again, much appreciated. DavidJameson 03:16, 13 Mar 2007 (NZDT)

Thanks, DavidJameson 05:22, 10 Mar 2007 (NZDT)

I've updated the treeview to version 3, unfortunately the syntax is different, but it's far more solid and the problems you mentioned above have been fixed too ;-) --Nad 16:47, 13 Mar 2007 (NZDT)
see http://www.mediawiki.org/wiki/Extension:Tree_view#Changes_in_version_3.0 for details of changes