We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37493
    • 16 Posts
    hi all,
    I've been using Evo for a few years now and this site is my first jump into revo. I'm figuring a bunch out from the forums but I've been looking at this particular problem for a couple days and I can't seem to find a clear answer out there.

    I'm trying to get phpthumbof to work with an image TV, that i call upon with getresources. when i just use the TV, i get the image perfectly. when i try to use php thumb, it just gives me the generated thumb's pathway in text.


    snippet call:
    
    [[!getResources? &parents=`10` &limit=`5` &tpl=`featuretemp` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &showHidden=`1`]]
    
    tpl chunk:
    <div class="event">
    	[[+tv.featurethumb:phpthumbof=`w=300&h=300&zc=1`]]
    	<h3><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h3>
            
    </div>
    
    

    the output i get instead of the image:
    /assets/components/phpthumbof/cache/westgay2.d9ffc2ce066f23b69f2b31c839306ac15.jpg

    AND- Ive go the input of the TV set to image, and the output set to text.


    what am i doing wrong? or is there a clear post already out there (ive been looking in the forums and havent found anything that actually helps on this one).

    its revo 2.2.4-pl and its on a godaddy host.




    This question has been answered by multiple community members. See the first response.

    [ed. note: geekster last edited this post 11 years, 7 months ago.]
    • discuss.answer
      • 37493
      • 16 Posts
      also, i dont understand why the code isnt showing up in that first post: i copied and pasted it from what im working on.......
      • discuss.answer
        You have to paste code into "code" tags (click the little <> button in the editor's toolbar).

          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
        • discuss.answer
          • 37493
          • 16 Posts
          anyone?
          • Are you sure that your server has ImageMagic installed?

            http://rtfm.modx.com/display/ADDON/phpThumbOf#phpThumbOf-Troubleshooting
              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
              • 37493
              • 16 Posts
              its a godaddy server. so I'm not sure. is this something i can do through .htaccess?


              Edit: I just googled it and godaddy does have it on their servers
              • Hi geekster,

                The phpthumbof output filter is operating on the processed output of your TV. That is to say, since you are using the "image" output type, the entire html image tag gets sent to phpthumbof. Phpthumbof expects a path to a file, not an html tag, therefore it is failing.

                Two options immediately come to mind:

                1) change the TV output type back to Default, so phpthumbof has a path to operate on (then you would have to place the image tag html into your template)
                2) write a custom output filter snippet to "wrap" phpthumbof functionality, but with additional smarts to parse the html image tag that the TV is creating, find the image path and send it to phpthumbof, then inject the thumbnail path back into the html image tag

                A third option has occurred to me but I have never tried this:

                3) Set your image TV output type to Default; create another TV (named for example "featurethumbwrapper"), just a regular text type but make it's default value
                [[*featurethumb]]
                and set it's output type to image. Then use
                [[*featurethumbwrapper]]
                in your template and you should end up with the html image tag containing the path to the thumbnail. (You could also achieve something similar with a Chunk as your html image tag template, and setting the
                [[*featurethumb]]
                TV as a property in the Chunk tag, e.g.
                [[$myImageTag? &thumb=`[[*featurethumb]]`]]
                where your myImageTag Chunk is something like <img src="[[+thumb]]"> .)

                Also, looking at your example, depending on how many TVs your aggregated Templates have, you may want to take advantage of the includeTVList and processTVList parameters of getResources so that you're not processing TVs that you aren't using in your getResources templates. (TV processing is a fairly expensive operation.)

                Hope this helps to get you back on track with Revolution. [ed. note: netProphET last edited this post 11 years, 7 months ago.]
                  Mike Schell
                  Lead Developer, MODX Cloud
                  Email: [email protected]
                  GitHub: https://github.com/netProphET/
                  Twitter: @mkschell
                  • 37493
                  • 16 Posts
                  thanks for your reply.

                  I had the output set to "text" as it specified in the documentation, so it should have the path it needs.

                  I tried option 1 with default, text and Image and its still outputting a filepath in text.

                  your options 2&3- sorry, but I dont follow.....
                  • geekster,

                    Ok, I did misread the information in your original post. To be clear, are you saying that if you put

                    [[+tv.featurethumb]]
                    


                    , i.e. without the phpthumbof filter, then you get an image tag in your output? And with the phpthumbof filter, you just get a path?

                      Mike Schell
                      Lead Developer, MODX Cloud
                      Email: [email protected]
                      GitHub: https://github.com/netProphET/
                      Twitter: @mkschell
                      • 37493
                      • 16 Posts
                      yes.