We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33238
    • 388 Posts
    Ok i have this code ( modx page, default News code)

    [[Ditto? &parents=`2` &display=`2` &total=`20` &removeChunk=`Comments` &tpl=`nl_sidebar`]]

    this code bring a list of resent news pages thet i create. something like.

    NEWS
    Here tittle link
    and here the long tittle like text comment.

    but if the page that i crate have an image, i need that (Ditto?) list show thumbnail image dynamically.

    like:

    HERE THE IMAGE 20x20px
    Here tittle link
    and here the long tittle like text comment.

    I hope you understand me, is my first post, please help. Thank you so much!!!
      --
      ysanmiguel.com
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I have been successfuly using the MiniPhoto snippet in my Ditto templates:
      <img src="[[MiniPhoto? &file=`[+photo+]` &width=`100` &height=`150`]]"  alt="[+pagetitle+]" />


      The client tends to upload all kinds of images, and I got tired of having to download the image, resize it, and upload it again for them. The only time this didn’t help was when somebody uploaded a sideways image...that one I had to download, rotate, and upload again rolleyes

      http://modxcms.com/extras/package/275

      It has a deprecated notice, but I was never able to find a different version.

        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
        • 24969
        • 120 Posts
        Susan,
        Can you please tell me where I should upload miniphoto so that when installed all will work... This is all just a little intimidating.

        -Rhyno
          The important thing is not to stop questioning. Curiosity has its own reason for existing. One cannot help but be in awe when he contemplates the mysteries of eternity, of life, of the marvelous structure of reality. It is enough if one tries merely to comprehend a little of this mystery every day. Never lose a holy curiosity.

          -Albert Einstein (1879 - 1955)

          Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Don’t let it intimidate you; it’s just like Legos.

          For install: extract files info ’assets/snippets/miniphoto/’ and make snippet ’MiniPhoto’ from ’miniphoto.snippet.php’

          So unzip the .zip file, and upload the miniphoto folder to your site’s assets/snippets/ folder.

          Delete that snippet.miniphoto.php file (or rename it to snippet.miniphoto.php.txt) from your assets/snippets/miniphoto folder; it’s dangerous to leave non-included .php files laying around like that.

          Then in the Manager, go to Elements -> Manage elements, and the Snippets tab. Click on "new snippet". Give it a name, MiniPhoto, and a description if you like, maybe "resizes photos for display". Copy the text from the snippet.miniphoto.php file and paste it into the snippet field.

          Now you can use the snippet call in the src attribute for your img tags, and it will resize the image before it gets sent.
          <img src="[[MiniPhoto? &file=`assets/images/myimage.jpg` &width=`100` &height=`150`]]"  alt="My Image" />


          Instructions and a description of the possible snippet parameters are in the beginning of the snippet code.

          I just used it in a very simple way in a Ditto chunk tpl, having the image path inserted automatically by a Ditto placeholder from a TV named "photo" used to upload the image
          &file=`[+photo+]`

          and two parameters to set the width and height.
          &width=`100` &height=`150`




            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