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

    I have a folder of images on my server for use as page headers.  I’d like to set up a TV so I can select which image to use on each page.

    As far as I can tell, the only way to get the contents of a directory is to use the @EVAL binding?
    @EVAL $files = scandir('./path/to/dir'); return implode('||', array_slice($files, 2));

    Is this the best approach, or is there another? It works, but I may have missed something wink

    Thanks,
    Peter
      MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
    • Make sure your images folder is in the assets/images folder. Now you can configure your TV to have the input type of "image" and the output widget type of "image".
        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