We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Is there a solution to links to images, phpthumbof and media sources with contexts? After searching for hours, I find numerous posts about the problems, but nothing more than guesses and suggestions that don't seem to work.

    I made all my css and js links absolute, but that doesn't seem to help with images. Since the Cloud uses nginx, I can't use any of the .htaccess rewrite suggestions.
      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
      • 40045
      • 534 Posts
      Hi Susan,

      what exactly is your problem, I got the mentioned components working in several sites with multiple contexts/sites (sometimes languages > babel, sometimes other Domains / Subdomains or all of them at once =D). Have to admit, it also caused some hairpulling for me but the most important thing I think is to set "baseUrlRelative" to "No" in the media source. And btw. I don't understand what the js and css paths have to do with phpthumbof =).
        • 1343 ☆ A M B ☆
        • 2,213 Posts
        Quote from: sottwell at Dec 22, 2012, 07:12 AM
        Is there a solution to links to images, phpthumbof and media sources with contexts? After searching for hours, I find numerous posts about the problems, but nothing more than guesses and suggestions that don't seem to work.

        I made all my css and js links absolute, but that doesn't seem to help with images. Since the Cloud uses nginx, I can't use any of the .htaccess rewrite suggestions.

        Yes, you can set the default media source per context including web, and then on TVs you would chose the context/media source desired. If you are using a context routing plugin then you can't have /contextname/assets/.... but otherwise you should be fine.

          Patrick | Server Wrangler
          About Me: Website | Tweets |  MODX Hosting
          • 17403 ☆ A M B ☆
          • 183 Posts
          Quote from: sottwell at Dec 22, 2012, 07:12 AM
          Is there a solution to links to images, phpthumbof and media sources with contexts?

          I created a friendly url for phpThumbOf on GitHub https://github.com/lokamaya/friendlyThumbOf. It's support context or base_url if its what you searching for.

          *) I guess you create something like Nuvo slider gallery, with thumbnail, css, js, etc...
            zaenal.lokamaya
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            I'm using a routing plugin that solves the need for .htaccess (Cloud runs on nginx and has no access to custom directives), along with pretty much exactly how this tutorial goes.

            At this point I've just hard-coded the list of images for the roundabout, since there only needs to be three or maybe five images, and it's working as expected. Eventually, though, I want to be able to use the MIGx TV I set up for the home page to select a few images from the Gallery directories, using a media source of /assets/gallery/ to narrow the folders down to Gallery's folders.

            http://gallery.sottwell.modxcloud.com
              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
              • 17249 ☆ A M B ☆
              • 165 Posts
              The same problem here.
              I'm using modxcloud, modx 2.2.14 and latest Gallery (1.6.2)
              thumbnails are not being generated (instead the original image is shown) when using a regular image tv with Gallery Media Source
              Getting a bit tired of fighting this thing.

              Any suggestions?
              There's a lot of forums posts that seems related to this and i still can't find a solution.

              Attached a screenshot

              Using a regular filesystem media source doesn't generate the problem but in my case turns things difficult for the client as the images are not easy to select digging through folders named with only numbers

              here's the error log:
              [2014-04-14 01:29:16] (ERROR @ /connectors/system/phpthumb.php) phpThumb was unable to generate a thumbnail for: /PATH_TO_CORE/core/cache/phpthumb/www.sitename.net__src4fde6f31231602afe0177461218c8abf_parb327585f9598dcd4b518f00264a6792b_dat0.jpeg
              [2014-04-14 01:29:16] (ERROR @ /connectors/system/phpthumb.php) Error outputting thumbnail:
              OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 578
              

              [ed. note: lithiumlab last edited this post 12 years, 5 months ago.]