We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14883 ☆ A M B ☆
    • 450 Posts
    I’d like to be able to select a directory with a TV. I tried using input type "File" but it only lets you select an actual file, not a directory.

    Thinking of submitting a feature request, but I’m wondering... is this behavior standard ExtJS behavior? Outside the reasonable scope of a feature request?
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      You could achieve this with a new (or modified File) input type variable.

      Expanding a directory in the MODX Browser triggers a number of events you can hook into - by default this is the listener that is added to the MODX browser for file tvs:
      listeners: { 'select': { fn:MODx.fireResourceFormChange, scope:this}}


      The "select" event seems to be triggered when you click "OK".
      The "selectionchange" event is triggered when selecting both an image and a directory, so you could hook up an event to that to enable the select button.

      I’d go for the feature request - an input option that decides if you can select files or directories would probably be a good idea if you ask me tongue
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 3749
        • 24,544 Posts
        If you just want this in the Manager, you might also consider using something like this in the TV:

         @EVAL return runSnippet('getDirectories', array('path'=>'path/to/parent/dir'));


        Then write a snippet called getDirectories to make the list.
          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