We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    <img src="[[DocInfo? &docid=`5` &field=`banner01`]]" alt="" width="420" height="300" />


    Can we use phpthumb when using DocInfo?
    [[phpthumb? &input=`[*banner01*]` &options=`w=420,h=300,zc=1,q=85`]]

    This doesn't work smiley
    [[phpthumb? &input=`[[DocInfo? &docid=`5` &field=`banner02`]]` &options=`w=420,h=300,zc=1,q=85`]] [ed. note: fourroses666 last edited this post 12 years, 3 months ago.]
      Evolution user, I like the back-end speed and simplicity smiley
      • 20371
      • 58 Posts
      I've been playing around with this a lot myself lately. There's a few things.

      Firstly, your call should be : (note the 'of' in phpthumbof)

      [[phpthumbof? &input=`[[DocInfo? &docid=`5` &field=`banner02`]]` &options=`w=420,h=300,zc=1,q=85`]] 
      


      But I should mention, I think (but not sure) phpthumbof is no longer supported, it's been forked as pThumb, which is updated regularly and fixes some bugs with phpthumbof. I was working around the zc bug with phpthumbof for months before I realised the existence of pThumb.

      Next, I've never used DocInfo, I think GetResourceField does the same thing? just in case docinfo gives you grief.

      And finally, I'll include a shoutout for http://mun.ee"" target="_blank" rel="nofollow">Munee which I discovered a few weeks ago. Installation is a snap. Unpack it, create munee.php, add the rewrite to your .htaccess. Then your calls in modx would look like this:

      <img src="[[DocInfo? &docid=`5` &field=`banner01`]]?resize=w[420]h[300]e[true]q[85]" alt="" width="420" height="300" />

      When the browser requests the url, it's rewritten to munee.php, which resizes, caches, et cetera.

      Why do I recommend it?

      • it's quick, does the same thing as phpthumbof, but I'm yet to find any issues
      • it handles images, css (& less/sass), and js (& coffee script); it compiles, catenates, minifies

      Good luck!
        • 9995
        • 1,613 Posts
        Hey Mr501, thanks but I'm on Evo not on Rev.
        Might help peoples who are on Rev, I'm bookmarking this for when I might need this smiley

        I know there is a possiblity with the old phpthumb snippet of Evo but its intergrated into Evo since version 1.0.12 and works better and different.

          Evolution user, I like the back-end speed and simplicity smiley
          • 13428 ☆ A M B ☆
          • 1,031 Posts
          Have you tried the following?
          [[phpthumb? &input=`[!DocInfo? &docid=`5` &field=`banner02`!]` &options=`w=420,h=300,zc=1,q=85`]]
            • 9995
            • 1,613 Posts
            that didn't work [! but this did [[

            Thanks both smiley

            [[phpthumb? &input=`[[DocInfo? &docid=`3` &field=`banner02`]]` &options=`w=120,h=100,zc=1,q=85`]]
              Evolution user, I like the back-end speed and simplicity smiley
              • 13428 ☆ A M B ☆
              • 1,031 Posts
              I don't see any difference between the call in your last answer and the one in your first question.
                • 9995
                • 1,613 Posts
                You are correct about that!

                I think the banner02 TV was empty then because I had an no-image output.

                Shame on me, I prolly didn't check good, I really didn't expect a snippet in a snippet would work so thats why I didn't do any further inspections.
                  Evolution user, I like the back-end speed and simplicity smiley
                  • 20371
                  • 58 Posts
                  ooh my bad.. I didn't notice the forum category :p don't mind me!