We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21163
    • 18 Posts
    Dear MODx people,

    all I ask is:
    What code do I have to put into my snippet to check if the current document is a container? As for use in an if-construct...

    A big Thanks!!

    René
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: neo2dot0 at Oct 15, 2007, 04:56 PM

      all I ask is:
      What code do I have to put into my snippet to check if the current document is a container? As for use in an if-construct...
      You can use something like this in a snippet to get the value from the document being rendered:
      if ($modx->documentObject['isfolder']) {
          // Do your stuff
      }