We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18862
    • 70 Posts
    Anyone have a good way to display images using the datagrid widget? Or if there is a better way to accomplish the same goal?
    The goal being: Easiest way to provide an end user with a method of choosing images from a directory to be included in an image gallery.

    I’ve tried creating a TV with the following:

    Input Type:  Listbox (Multi-Select)
    Input Option Values:  @DIRECTORY assets/images/
    Widget:  Data Grid
    


    If I change the widget type to Image this works fine. But if I choose Data Grid then it puts the text value of the directory+filenames one character in each cell of the data grid. ie: a s s e t s / i ....etc. in each cell.

    If anyone has any suggestions of a better/easier way to do this and make it easy for a user to choose images to display I’ll definitely change my approach. smiley

    thanks.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Why not just use the TV with an input type of Image? That loads the resource browser, the user goes to the relevant directory and chooses the 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
        • 18862
        • 70 Posts
        Because that only allows them to choose one image as far as I am aware.

        I’d like for them to be able to choose multiple images using only one TV. I know you can use the || separator if you manually type it in, but I don’t know if there is a way to use the resource browser to automatically format it like image1||image2||image3...
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Ah, I missed that part about wanting to select multiple images at once.
            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