We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37984
    • 215 Posts
    Hey all - MIGX newb, but loving it so far. I've got a somewhat simple question though.

    I'm using MIGX to power an image gallery for a new site, and I would like to specify a media source for it to use. I've tried creating a media source with a base href and base url that look like this:

    [[migxResourceMediaPath? &pathTpl=`assets/images/gallery_images/{id}/`]]


    and then assigning that media source to my MIGX tv. The issue is, no matter what I do, the file browser still shows the root folder instead (what it would do if no custom media source was specified). Can I get a little help from you MIGX veterans? Thanks a million!

    This question has been answered by louveblr. See the first response.

      Jesse Couch
      MODX Aficionado, Front-End Designer & Developer
      http://www.designcouch.com
    • The media source should be assigned to the "helper" image TV, not to the MIGx TV itself.
        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
        • 37984
        • 215 Posts
        To be clear, I've only created one TV (the MIGX one) and it works fine; are you saying that I should create another TV (the 'helper') with the same name as the one cited in my JSON string in my MIGX TV?
          Jesse Couch
          MODX Aficionado, Front-End Designer & Developer
          http://www.designcouch.com
          • 4172
          • 5,888 Posts
          There are several ways how you can assign a mediasource to a MIGX-image.

          If you are configure the MIGX-TV directly in the formtabs of the MIGX-TV-input-options,
          you may have either

          "inputTV":"anyImageTv"


          than you will need to have a image-TV with name 'anyImageTv' (no template assigned) and assign the mediasource to that TV

          or

          you can do it this way:


          [{"caption":"test"},{"fields":[
          {"field":"image","caption":"Image","inputTVtype":"image","sourceFrom":"migx"},
          {"field":"image2","caption":"Image","inputTVtype":"image","sourceFrom":"config","sources":"[{\"MIGX_id\":\"1\",\"context\":\"web\",\"sourceid\":\"3\"},{\"MIGX_id\":\"2\",\"context\":\"de\",\"sourceid\":\"3\"}]"},
          {"field":"test2","caption":"test2"}]}]
          


          the first image-field has its source from the migx-TV
          the second image-field has its source from its own configuration under the sources-config

          or you can do all that from the MIGX-configuation-CMP without messing arround with json-strings



            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 37984
            • 215 Posts
            Perfect, Bruno. I used the option you demoed for the first image, and it worked like a charm.
              Jesse Couch
              MODX Aficionado, Front-End Designer & Developer
              http://www.designcouch.com
            • MIGx never ceases to amaze me. Is there anything it can't do?
                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
                • 49989
                • 19 Posts
                Hello. Trying to make a gallery with the help of this tool. There is a need to work with it dropbox-2.1.2-beta.
                Additional field (TV): GalleryPhoto
                Tabs form:
                [{"caption":"Image", "fields": [
                    {"field":"set","caption":"Set"},
                    {"field":"description","caption":"Description"}, 
                 {"field":"image","caption":"Image","inputTVtype":"image","sourceFrom":"migx"}
                  ]
                }]

                Column layout:
                [{
                  "header": "Set", "sortable": "true", "dataIndex": "set"
                },{
                  "header": "Description", "sortable": "true", "dataIndex": "description"
                },{
                  "header": "Image", "sortable": "false", "dataIndex": "image","renderer": "this.renderImage"
                }]

                That leads to an error on the site
                Fatal error: Call to a member function getOption() on a non-object in /home/user1166533/www/jinini.com/core/components/dropbox/model/dropbox/dropboxmediasource.class.php on line 1275
                https://jinini.com/index.php?q=gallery/photography/events.html
                Please help
                  • 49989
                  • 19 Posts
                  <ul>
                  [[!getImageList?
                  &tvname=`GalleryPhoto`
                  &tpl=`@CODE:<li>[[+idx]]<img src="[[+image]]"/><p>[[+title]]</p></li>
                  `]]
                  </ul>
                    • 4172
                    • 5,888 Posts
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                    • discuss.answer
                      • 49989
                      • 19 Posts
                      Quote from: Bruno17 at Apr 07, 2015, 02:18 PM
                      https://github.com/MODX-Club/modx-Dropbox/blob/master/core/components/dropbox/model/dropbox/dropboxmediasource.class.php#L1275

                      seems for whatever reason

                      $this->ctx


                      isn't a context-object at this time.

                      I am very bad at programming. Please tell me how it should be.