Можно!
пошаговая инструкция:
Создаешь TV DropDownTree, тип Check Box, возможные значения @EVAL return $modx->runSnippet("DropDownTree",array(’doc’=>0));
’doc’=>0 -- сюда подставляешь необходимый ID, корень дерева, которое надо прошерстить.
Создаёшь Сниппет DropDownTree
<?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")){ 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']."==<li><a href='[~".$k['id']."~]'>".$k['pagetitle']."</a></li>||"; $out.=getItems($k['id'],$l+1); } return $out; }}return getItems($doc);
?>
На странице ссылки выводишь так
<ul>
[*DropDownTree*]
</ul>
Это самая простая реализация.
UPD
Лучше для TV пришить widget --> HTML Generic Tag --> Tag Name: ul
а в шалоне выводить просто так