We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17459
    • 268 Posts
    Hello!

    Why do I can use
    <?php
    $output = $modx->documentIdentifier; return $output;
    ?>

    in snippet and can’t in TV (if resource exist)?

    @EVAL $output = $modx->documentIdentifier; return $output;

    Also I tried $modx->documentObject[’id’]

    Evo 1.0.3

    P.S. $modx->getDocumentChildren (for example) in TV works well..


    I need create TV with list of sub-resources (if there are any). How to do it?

    Thanks!
      • 4310
      • 2,310 Posts
      Try $_REQUEST[’id’] to get the current document ID for use in a TV @EVAL statement
      • This worked for me
        @EVAL return $modx->documentIdentifier;
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 17459
          • 268 Posts
          Thanks, bunk58!


          sottwell, what modx version do you use for testing? I’m on Evo 1.0.3 now..
          • 1.0.3; I update my localhost from SVN every week or so.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org