We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34000
    • 77 Posts
    Surprised not to see the tutorial from Kartonista about converting an www.os-templates.com template to revo, mentioned any place in the forums.
    I’m wondering about the best way to name images for the slider, the tutorial just uses ID.
    I wouldn’t want to name the image just with a simple ID number that MODx would assign to it, but rather something more descriptive?

    Copied the entire coded bit below from the page here:
    http://www.kartonista.com/tech/port-os-template-to-modx-revo.html
    thanks for any suggestions.

    From the tut:
    --------------------
    Create a new chunk labeled “features” and will contain the following code.

    <li><a href="[[~[[+id]]]]"><img src="assets/images/features/[[+id]].jpg" alt="[[+longtitle]]" /></a></li
    


    This means that if you have a new article/post, you just have to create a corresponding JPG picture measuring 150×130, name it with the id number of the article, and upload it to the “assets/images/features/” directory.
    --------------------

    Any suggestions for other image handling resources would be great too.
      MODx Revo 2.1 and done!
      • 33968
      • 863 Posts
      I’d use an image TV instead. That way you can easily see which image is associated with a resource, have more control over the filenames, and update the image without needing access to the file manager or ftp.

      Create a ’image’ type TV - let’s call it imageTV.

      Update the getResources call to include TVs:
      [[!getResources? &parents=`1,2,3,4,5` &tpl=`features` &limit=`20` &includeTVs=`1` &processTVs=`1`]]
      


      And change your chunk to something like:
      <li><a href="[[~[[+id]]]]"><img src="[[*tv.imageTV]]" alt="[[+longtitle]]" /></a></li>
      
        • 34000
        • 77 Posts
        Thanks for the advice, after posting the question, I snooped through the Revo doc’s and sort of decided maybe a TV was what I needed to delve into. As a newbie still, I decided it was best to sit and wait for a code hint, and keep my mouth shut so as not to clutter up the help thread, lol.

        Thanks alot.

        Are there any good image handling tutorials someplace, I was also wondering if I’ll want to use phpthumb, but that will be a later improvement to a template, got to go agile or nothing’s going to get started.

        Mary’s tutorial on TV’s will no doubt be a big help:
        http://codingpad.maryspad.com/2011/02/07/modx-revolution-for-complete-beginners-part-6-working-with-template-variables/

          MODx Revo 2.1 and done!