Jako's your solutions seems to be very elegant as Ditto comes with PHx anyways. However I don't know how to install it properly. I know this thread is old but am still hoping for a hint.
I don't know where to save the phx and how to name it. Also the bracket-star notation [*phx .. *] seems unusual. Is this correct?
My goal seems simple enough. Below you can see my ditto config for which I'd need my second level list in an <ul></ul>
if nonempty. The second level config looks similar but without any further Ditto call.
<?php
$tpl = '@CODE:
<li class="level1">
<a href="[~[+id+]~]">[+pagetitle+]</a>
<ul>
[!Ditto? &startID=`[+id+]` &config=`subnavlevel2`!]
</ul>
</li>
';
$tplLast = '@CODE:
<li class="level1 last">
<a href="[~[+id+]~]">[+pagetitle+]</a>
<ul>
[!Ditto? &startID=`[+id+]` &config=`subnavlevel2`!]
</ul>
</li>
';
$noResults = ' ';
$where = 'template = 5';
$sortBy = 'menuindex ASC';
?>