Hi,
I was just doing this today !
So here how I managed it:
First go to http://www.mattkruse.com/javascript/mktree/source.html and download the files mktree.js, mktree.css, plus.gif, minus.gif and bullet.gif. Create a new directory named mktree under your wp-content/plugins/ directory. Then install the below plugin and you’re done !
<?php
/*
Plugin Name: PagesMenuTree
Plugin URI:
Description: This scripts convert <UL> and <LI> tags of the Pages section into a collapsible tree.
Version: 1.0
Author: Y. Jeannotat (Danaher Motion SA)
Author URI: http://www.danaher-motion.ch
*/
/*
INSTRUCTIONS:
No edits to the WordPress source are required.
Just save the plugin into your WordPress plugins directory, and then
Activate it on the Plugins tab of the WordPress admin console.
Read the comments below
*/
add_filter(‘wp_head’, ‘listCollapse’);
function listCollapse()
{
?>
<SCRIPT SRC=”wp-content/plugins/mktree/mktree.js” LANGUAGE=”JavaScript”></SCRIPT>
<LINK REL=”stylesheet” HREF=”wp-content/plugins/mktree/mktree.css”>
<SCRIPT LANGUAGE=”JavaScript”>
//<![CDATA[
window.onload = function ()
{
if (document.getElementById)
{
// Find the page section
var cat = document.getElementById(‘pagenav’);
if (cat != null)
{
// Then get the root of the tree
var root = cat.getElementsByTagName(‘UL’)[0];
if (root != null)
{
root.className = “mktree”; // Give it the MKTree class
convertTrees(); // And now transform it into a tree !!!
}
}
}
}
//]]>
</SCRIPT>
<?php
}
?>
Thanks for the feedback. I ended up with this error:
Warning: Cannot modify header information – headers already sent by (output started at /home/motorcyc/public_html/wp-content/plugins/mktree/mktree.php:48) in /home/motorcyc/public_html/wp-admin/admin.php on line 6
Warning: Cannot modify header information – headers already sent by (output started at /home/motorcyc/public_html/wp-content/plugins/mktree/mktree.php:48) in /home/motorcyc/public_html/wp-admin/admin.php on line 7
Warning: Cannot modify header information – headers already sent by (output started at /home/motorcyc/public_html/wp-content/plugins/mktree/mktree.php:48) in /home/motorcyc/public_html/wp-admin/admin.php on line 8
Warning: Cannot modify header information – headers already sent by (output started at /home/motorcyc/public_html/wp-content/plugins/mktree/mktree.php:48) in /home/motorcyc/public_html/wp-admin/admin.php on line 9
It gave double bullets and no ‘+’ or ‘-‘.
I am a newb using the Cleanbreeze theme and don’t know much about php. Any thoughts?
Has anyone gotten this working? I’ve got the plugin activated, but it’s not having any effect on my page menu. Is there a step that hasn’t been mentioned here? Perhaps there’s some code to be added to sidebar.php?