We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10226
    • 412 Posts
    Currently I create thumbnails and images manually, my thumbnails are usually a crop of the big picture, not an actual thumbnail.

    I upload all my pics and thumbs to the images folder, I name the thumbs th_xxxx and the pics are xxxx.

    Possibly through a plugin / snippet, could there be a way to only specify the image name, and the backend automatically add the link for the th_? So when we call for [+picture+] it can also create [+th_picture+] on the fly?

    Hope I was clear enough with my idea.

    Thanks.
      • 7231
      • 4,205 Posts
      If they are in the same directory cant you simply do "th_[+picture+]" and have the path hard coded into the ditto template:

      /assets/images/th_[+picture+]
      and
      /assets/images/[+picture+]
      

      Or are you talking about a image TV?
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 10226
        • 412 Posts
        That looks slick and simple, but yeah it was an image tv so I could easily see what pic I was selecting, they are all in the same dir. Although I usually have the images folder on the server open - since I have it mapped as a network drive I can just grab the name from there. I have a photoshop script that sizes and exports for me... So I could make a chunk with /assets/images/ in it and do ((img_path))th_[+picture+] - I’m starting over from scratch anyway (and a fair google cache smiley )

        Think I will go with that smiley
          • 7231
          • 4,205 Posts
          If you are going that way you may consider using the alias as the image name and not need TV at all. I did this for section images on a recent site and it worked great (as long as the editor remembers to add the alias).

          ((img_path))th_[+alias+].jpg

          As for creating a snippet, since Ditto has PHx built in you may be able to use a PHx custom modifier to automate the thumbnail path: http://wiki.modxcms.com/index.php/PHx/CustomModifiers

            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 10226
            • 412 Posts
            I went with my rough example mentioned earlier. I don’t think the alias would work because most pages have more than one image, some have one, some have four...