UPDATE : A download package is available here : http://ideamesh.com/file/11/Smarty-Debug-with-Collapsible-Variables.html
Here is the modified code, working and ready to go..
Here is the link where you can download the nanotree javascript…
http://nanotree.sourceforge.net/
Replace my variable {$Site.framework_pub} appropriately so that the javascript and images can be loaded correctly.
Also please note, I have added in a section to handle user defined debug vars… My debug structure is named ‘_user_debug’ and ‘_user_debug_key’
For more info on how to implement this look at this thread :
http://www.smarty.net/forums/viewtopic.php?p=31241#31241
Otherwise if you aren’t interested, it is safe to remove that section from the template. You could also remove the {if} statement I used to wrap the template var section.
Another thing you might want to play with is how many characters are output as the value for debug. Look for this and modify the second number to alter the max chars output :@debug_print_var:0:1000
PS Can anyone figure out why I am getting a space above the <h3> in the right cell?
Hope this helps, I know I like it ![]()
PS To get all the javascript working correctly you only need to modify the line “var mynanopath = ” and make sure it points to your public nanopath directory. You can down the nanotree package from http://sourceforge.net/projects/nanotree/
Here is the updated code
| Code: |
| {* Smarty Custom DHTML Debug Template @author Hielke Hoeve @author Owen Cole <owenc at ideamesh dot com> @since 02/13/2006 Smarty 2.6.12 @package Smarty @filename debug.tpl *} {assign_debug_info} <SCRIPT language=javascript> if( self.name == ” ) {ldelim} _smarty_console.document.write(” \/**\n”); _smarty_console.document.write(” \/**\n”); _smarty_console.document.write(” function nodeEdited(treeNode) {ldelim}\n”); _smarty_console.document.write(” var closedGif = ‘” + mynanopath + “images\/folder_closed.gif’;\n”); {* Create base node *} {* Create node for template includes *} _smarty_console.document.write(” rootNode.addChild(node{$counter});\n”); {* Create node for user debug variables *} {* Create child nodes for user debug variables *} {* Create node for template variables *} {* Create child nodes for template variables *} {* Create node for smarty config file variables *} {* Create child nodes for smarty config file variables *} _smarty_console.document.write(”\/\/–>\n”); |









































