We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38318
    • 128 Posts
    I have a news blog using articles which works fine. I'm creating a news page that displays all the latest posts. This works fine but I would like an image from the post to show with it. Images in each news item are by tvs. Here is my code:

    <li>
    <a href="[[~[[+id]]]]" title="[[+pagetitle]]">     
             <img src="[[+tv.NewsImage:phpthumbof=`w=153&zc=1`]]" alt="[[+pagetitle]]" />
             </a>  
    <div>
    <h3>[[+pagetitle]]</h3>
    <span>[[+publishedon:strtotime:date=`%b %d, %Y`]] | Posted by <span>[[+createdby:userinfo=`fullname`]]</span></span>
    <p>[[+introtext]]</p>
    <a href="[[~[[+id]]]]">Read More</a>
    </div>
    </li>


    No image is displayed. No file path is being parsed to src. It's <img alt="Season kick off" src=""></img>

    In the the error log it says:
    (ERROR @ /connectors/system/phpthumb.php) Error outputting thumbnail:
    OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557
    [2013-08-11 18:26:37] (ERROR @ /connectors/system/phpthumb.php) phpThumb was unable to generate a thumbnail for: /home/username/public_html/core/cache/phpthumb/phpThumb_cache_mydomain_src92d08988004a309b8c7d065ba969feee_paradf896d45f319fa323d889e84ccb98c5_dat0.jpeg

    Am I doing something wrong? PhpThumbOf is installed.
      • 44234
      • 219 Posts
      Don't think you need to prefix the tv placeholder. Try:
      <img src="[[*NewsImage:phpthumbof=`w=153&zc=1`]]" alt="[[+pagetitle]]" />
        Find me on Twitter, GitHub or Google+
        • 38318
        • 128 Posts
        Thanks, just tried that but get the same effect.
          • 44234
          • 219 Posts
          Does it work without phpthumb?
          <img src="[[*NewsImage]]" alt="[[+pagetitle]]" />
            Find me on Twitter, GitHub or Google+
            • 38318
            • 128 Posts
            Unfortunately no.

            Is it something to do with permissions maybe on the thumbnail folder?

            Each post has a different image in the TV, am I supposed to point the ID of the post as well or is that being done by the href?
              • 44234
              • 219 Posts
              Might also be because your not specifying a height. From the docs:
              zc = zoom-crop. Will auto-crop off the larger dimension so that the image will fill the smaller dimension (requires both "w" and "h")
                Find me on Twitter, GitHub or Google+
                • 44234
                • 219 Posts
                Quote from: evegate94 at Aug 12, 2013, 04:59 AM
                Unfortunately no.

                Is it something to do with permissions maybe on the thumbnail folder?

                Each post has a different image in the TV, am I supposed to point the ID of the post as well or is that being done by the href?
                Oh ok, it's a tv problem then. Double check the name is correct and try a different image.
                  Find me on Twitter, GitHub or Google+
                  • 38318
                  • 128 Posts
                  Just tried it as
                  <img src="[[*NewsImage:phpthumbof=`w=300&h=200&zc=1`]]" alt="[[+pagetitle]]" />

                  but no luck
                    • 44234
                    • 219 Posts
                    Can you see a preview of the image selected in the tv when editing the resources?
                      Find me on Twitter, GitHub or Google+
                      • 38318
                      • 128 Posts
                      There is a preview and the tv works as the images show in the full news item itself: The code I use there is:
                      			<div class="body news-single">
                      				<div>
                      					<span>News</span> <a href="news.html" id="paging">> Back</a>
                      					<div>
                      						<img src="[[*NewsImage]]" alt="News image" width="670">
                      						<h3>[[*pagetitle]]</h3>
                      						<span>Posted on [[*publishedon:strtotime:date=`%b %d, %Y`]]  | Posted by <span><a href="[[~[[*parent]]]]author/[[*publishedby:userinfo=`username`]]">[[*publishedby:userinfo=`username`]]</a></span></span>
                      						<p>[[*content]]</p>
                      <img src="[[*NewsImage2]]" alt="News image2" width="300" align="left">
                      <img src="[[*NewsImage3]]" alt="News image3" width="300" align="left">
                      					</div>
                      </div>
                      </div>


                      All 3 tvs display.