We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13218
    • 134 Posts
    Hi,
    it seems I'm doing something wrong when calling Image+. This is how I'm doing it:

    - TV output is set to Image+, no parameters, no chunk, no thumb url.

    - Calling the tv like this:
    $myImg = $modx->runSnippet("ImagePlus", array(
              "docid"   => 641,
              "tvname"  => "imgplustest",
              "type"    => "tpl",
              "tpl"     => "myimgtest"
            ));


    - The chunk "myimgtest" is like this:
    <img src="[[+source.src:pthumb=`[[+options]]`]]">


    The problem here is, that this way the &s in the [[+options]]
    sx=452&sy=304&sw=373&sh=497&w=250

    inside the chunk are urlencoded as amp;

    This breaks the options and cropping is messed up. When I replace the & amps;s (with output modifier), everything's fine.
    What am I doing wrong?
    [ed. note: itWillBeOk last edited this post 7 years, 3 months ago.]
      @itWilllBeOK
      • 13218
      • 134 Posts
      My temporary fix is to use an output modifier on the [[+options]] value to replace the urlencoded ampersands like so:
      <img src="[[+source.src:pthumb=`[[+options:replace=`&==&`]]`]]" alt="[[+alt]]">


      Using the apparently much simpler [[+url]] placeholder doesn't work either. It produces the same results as before.
        @itWilllBeOK