We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50887
    • 6 Posts
    What I imagine:
    - the user placing images in his RT-editor, adding a class 'thumb_show', adding an alt text that becomes caption below, in the enlarged image. He also adds width and height for the thumbnail. This all can be done simply in whatever editor, and that is essential. The user should not touch the html code directly.
    - ModX processing the page and when finding a IMG with that class 'thumb_show' auto-resizes (makes smaller) the thumbnail based on width and height, and adding necessary code to show the large unprocessed image in a lightbox/slimbox/highslide way, with alt-text as caption, and original dimensions.

    What packages outthere come close to what I want? I tried DirectResize, but it affects all images in a page, and documentation is poorly. I did not investigate 'Gallery' yet. I lack the OOP knowledge to write a package myself, yet..

    Thank you for suggestions and working solutions on this.
    Harry (using Revo, the latest version)
      • 50887
      • 6 Posts
      Ok, I found the answer to my own question, although it was a long and winding road..
      • In Revo, install the package DirectResize Revo version 1.0.5-pl.
      • In Revo go to system settings. Where you see 'core' above, that's a select menu, choose directresize.
      • Set 'Activating lightbox to 1. This way it only works when a img class="highslide" is found, and all other images are left alone.
      • Adapt Max Width and Max Height. I use 1024px, the original settings 500 and 700 are a bit small.
      Till so far these settings.
      • No go to highslide.com and download the latest 4.1.13 version from Highslide.
      • Grab the highslide.packed.js, open it in text-editor, and add the following line at the bottom of the code:
      hs.captionEval = 'this.thumb.alt';
      This way, the img alt text will pop-up as a caption below the image when enlarged. You can also use title, but alt is required, and every editor supports alt.
      • In assets/components/directresize/js: replace highslide.packed.js with the latest one, v 4.1.13 that you just edited. (The original is a 2008 version, the latest a 2011 version.)
      • Also replace the graphics folder in that location with the newest one. All this can be found in the downloaded zip from the highslide site.
      DirectResize seems not to load any css. In my template I added:
      <link href='assets/js/highslide/highslide.css' rel='stylesheet' type='text/css' />
      of course using the latest 4.1.13 css, and you may choose of course another path. The only thing I changed in the css is a text-align:center on the caption. A lot of css can be stripped by the way.
      In your html:
      <img class="highslide" src="assets/images/yourimage.jpg" alt="your alt/caption text" width="???" />
      Note that it seems not necessary to add both width and height, if one of the two is given it seems to be enough.
      (My paths are relative due to local MAMP, might be that absolute paths (/assets) is better for you.)

      This solution meets exactly my own requirements, in my fourth day exploring ModX.. hope it helps you too.
      Harry