We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50923
    • 137 Posts
    I am checking some value in Modx 2.4.3 with [[*isfolder]], it works ok when resource is folder but when it si not there is no value, when it is folder it output 1


    [[*isfolder:is=`1`:then=`
         WORKING
    `:else=`
         NOT WORKING
    `]]


    It does not even gets in here because it looks like there is no property *isfolder, i dont know why it outputs 1, and then nothing??
      <a href="www.play2web.com" title="izrada web sajtova">Izrada web sajtova</a>
      • 3749
      • 24,544 Posts
      I don't know why that wouldn't work. Try putting it all on one line.

      I would use a simple snippet for that, since it would be much faster:

      [[!CheckIsFolder]]



      /* CheckIsFolder snippet */
      
      return $modx->resource->get('isfolder') 
          ? 'WORKING'
          : 'NOT WORKING';


      It also makes it easier to pull in and return a Tpl chunk based on whether the resource is a folder or not, which is where I suspect you might be heading.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting