We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14167
    • 55 Posts
    I am wanting to add a thumbnail of a image I use for blog posts in to the latest articles chunk.

    I have been looking at 'phpthumbof' for the image thumb, but can't seem to get the template variable image showing in the chunk.

    Any ideas?
      Linux, PHP 5.2, MySQL 5.0, Revo 2.2.0-pl2
      • 38705
      • 101 Posts
      Hi jimboroberts,

      in the latest article I use getResourceField for the getting of the thumb:
       
      [[getResourceField:phpthumbof=`w=200&h=140&zc=1&q=70`? 
      &id=`[[+id]]` 
      &field=`NewsPict` 
      &isTV=`1`]] 
      

      Where NewsPict is a TV for articles.
      This might not be the best way but it works for me. (Maybe someone with a better idea?)

      while in the articlerow I use this:
      <div class="post_thumb">
          <a href="[[~[[+id]]]]">
              <img src="[[+tv.NewsPict:phpthumbof=`w=602&h=224&zc=1&q=80`]]" class="pic" />
          </a>
      </div>
      


      Hope it helps. [ed. note: mintnl last edited this post 14 years, 6 months ago.]
        Addict since 2012....
        • 3109 ☆ A M B ☆
        • 894 Posts
        If the image is part of the article you shouldn't use getResourceField that will do more damage than good.

        Do you have an example of what you want to achieve?. You should be able to use the image TV with php thumb to render it but it might be better to just make an image that's properly sized to improve performance.
          Benjamin Marte
          Interactive Media Developer
          Follow Me on Twitter | Visit my site | Learn MODX
          • 3109 ☆ A M B ☆
          • 894 Posts
          If the image is part of the article you shouldn't use getResourceField that will do more damage than good.

          Do you have an example of what you want to achieve?. You should be able to use the image TV with php thumb to render it but it might be better to just make an image that's properly sized to improve performance.
            Benjamin Marte
            Interactive Media Developer
            Follow Me on Twitter | Visit my site | Learn MODX
            • 14167
            • 55 Posts
            In the end, rather than use the latest article snippet I created my own template and used 'getresources'
              Linux, PHP 5.2, MySQL 5.0, Revo 2.2.0-pl2