<![CDATA[ Support/Comments for DropDownTree - My Forums]]> https://forums.modx.com/thread/?thread=44968 <![CDATA[Re: Support/Comments for DropDownTree]]> https://forums.modx.com/thread/44968/support-comments-for-dropdowntree#dis-post-258861
Made a few changes:

  • Now shows a "Choose..." option at the top of the list
  • Moved the separator so there’s not a blank item at the bottom
<?php
/*
#   Name:    DropDownTree
#   Version: 1.0.0
#   Author:  Urique Dertlian ([email protected])
#   Date:    Oct 4, 2007
#   Using:   Create TV of kind "DropDown List Menu", feel elements field with string:
             @EVAL return $modx->runSnippet("DropDownTree",array('doc'=>0));
             
             Here "0" is ID of parent document children of which will be displayed in DropDown menu.
*/

if(!function_exists("getItems"))
{
	$s="Choose...==''";
 	function getItems($p=0, $l=0)
	{
		global $modx,$modx_charset;
		($modx_charset=='UTF-8') ? $nbsp=chr(0xC2).chr(0xA0) : $nbsp=chr(0xA0);
		$c=$modx->getDocumentChildren($p);
		foreach($c as $k)
		{
			$out.='||'.str_repeat($nbsp,$l*5).$k['pagetitle']."==".$k['id'];
			$out.=getItems($k['id'],$l+1);
		}
	return $out;
	}
}
return $s.getItems($doc);
?>



]]>
jdelight Nov 15, 2007, 01:10 PM https://forums.modx.com/thread/44968/support-comments-for-dropdowntree#dis-post-258861
<![CDATA[Re: Support/Comments for DropDownTree]]> https://forums.modx.com/thread/44968/support-comments-for-dropdowntree#dis-post-258860
regards.]]>
zaigham Oct 24, 2007, 03:10 PM https://forums.modx.com/thread/44968/support-comments-for-dropdowntree#dis-post-258860
<![CDATA[Re: Support/Comments for DropDownTree]]> https://forums.modx.com/thread/44968/support-comments-for-dropdowntree#dis-post-258859 therebechips Oct 24, 2007, 10:57 AM https://forums.modx.com/thread/44968/support-comments-for-dropdowntree#dis-post-258859 <![CDATA[Re: Support/Comments for DropDownTree]]> https://forums.modx.com/thread/44968/support-comments-for-dropdowntree#dis-post-258858
I can think of a bunch of things I’ll do with this one smiley
Will test and report...]]>
davidm Oct 05, 2007, 02:00 AM https://forums.modx.com/thread/44968/support-comments-for-dropdowntree#dis-post-258858
<![CDATA[Support/Comments for DropDownTree]]> https://forums.modx.com/thread/44968/support-comments-for-dropdowntree#dis-post-258857 DropDownTree.

Use this forum to post any comments about this addition or any questions you have regarding its use.

Brief Description:
DropDownTree a method to display DocumentTree in dropdown TV for selection.]]>
Urique Oct 05, 2007, 01:48 AM https://forums.modx.com/thread/44968/support-comments-for-dropdowntree#dis-post-258857