We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8416
    • 173 Posts
    Hello,
    I’ve created a TV with the default contents as below. I want to return the document id is it has children otherwise I want to return its parent...pretty straightforward... however, I can’t seem to get it to work. Is there an obvious mistake? I want to use this TV in a wayfinder snippet to set the &startId parameter.

    @EVAL if (count($modx->getDocumentChildren($docid, 1, 0,'id')) > 0) return $docid; else return $modx->getParent($docid,1,'id');
    


    Thanks for your help.