We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43170
    • 3 Posts
    Hi,
    surely i'm a noob, this is my first website in MODX, but i have a little problem. I try to nest two migx TV and all works perfectly, except that in the nested TV this.renderImage does not work.

    The outer migx TV config:
    [
    {"caption":"Tabs", "fields": [
        {"field":"name","caption":"Name","inputTV":"SliderName"},
        {"field":"slides","caption":"Slides","inputTV":"Slides"},
        {"field":"sort","caption":"Sort Order","inputTV":"SortOrder"}
    ]}
    ]
    
    [
    {"header":"Name","sortable":"true","dataIndex": "name"},
    {"header":"Sort Order","sortable":"true","dataIndex": "sort"}
    ]
    


    The inner:
    [
    {"caption":"Slides", "fields": [
        {"field":"image","caption":"Image","inputTV":"SlideImage"},
        {"field":"caption","caption":"Caption","inputTV":"SlideCaption"},
        {"field":"video","caption":"Video","inputTV":"SlideVideo"},
        {"field":"sort","caption":"Sort Order","inputTV":"SortOrder"}
    ]}
    ]
    
    [
    {"header":"Image","sortable":"false","dataIndex":"image","renderer":"this.renderImage"},
    {"header":"Sort Order","sortable":"true","dataIndex":"sort"}
    ]
    


    revo 2.2.6-pl.
    migx 2.3.2-pl.
    Custom media source defined in the TV SlideImage.
    If i use the inner migx directly in a template, thumbs are rendered.
    In the error log i found lot of these:

    [2013-03-25 10:41:37] (ERROR @ /connectors/system/phpthumb.php) phpThumb was unable to generate a thumbnail for: /mnt/target03/352047/397107/my.domain.tld/web/content/core/cache/phpthumb/phpThumb_cache_my.domain.tld_srcb6ef40fa371bb068ef7357a6a83a44e9_parfe75230c38c1dd77cfb659e43ae25583_dat0.jpeg
    [2013-03-25 10:41:37] (ERROR @ /connectors/system/phpthumb.php) Error outputting thumbnail:
    OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557

    Thanks. [ed. note: mirkosassetti last edited this post 13 years, 6 months ago.]
      • 43170
      • 3 Posts
      I found that the problem is in the custom media source that does not work at the nested level. All works if i use the standard media source. I also noticed that in the rendered code, in the phpthumb call, &source is equal to 1, like the specified media source isn't read.
      Is a bug?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I always assign the media source to the embedded image-type TV, and leave the MIGx TV without any media source assignment. So far I haven't run into any problems with it.
          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
          • 43170
          • 3 Posts
          Quote from: sottwell at Mar 27, 2013, 10:06 AM
          I always assign the media source to the embedded image-type TV, and leave the MIGx TV without any media source assignment. So far I haven't run into any problems with it.

          You mean like in my example code?

          I made some other tests: the much working configuration i found is by configuring all with the migx configurator, defining all fields as inputTVtype except the migx TV where i define my custom media source; next, in the image field in migx configurator i set "source From" to "migx". Now the backend works perfectly, the only problem is in the frontend where the output of the image field is without the media source part. Not a big problem, i add the path manually in the template, for now.

            • 50312
            • 34 Posts
            I have the same problem. I know this thread is 3 years old, but still the exact same behaviour applies to me right now.

            Inside my MAIN migxTV the image from a NESTED migxTV won't render on the columns. In the image field of the formtab of my nested migxTV I have set the Media Source to "config", context: web and the correct ID (which is 3). When I select an image, the media source applied loads just fine and I end up in the right folder. It just won't render on the columns.

            When inspecting the code, I also can see the param "&source=1", but I guess this should be "3":

            <img src="/modx/connectors/system/phpthumb.php?h=60&src=path/to/image/myimage.jpg&source=1" alt="">
              • 50312
              • 34 Posts
              I just found the solution. On the Formtabs under the tab "Media Source" just set both contexts: web and mgr with the ID of your Media Source.