We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    Description

    getImagesFromHtml can be used as an outputFilter for MODX - Revolution to extract one or more images from html.

    This is usefull to get images for example added by richtexteditors like Redactor or tinyMCE from a field or TV.

    Examples
    get first image-src from content:
    [[*content:getImagesFromHtml=`1`]]


    together with pthumb or phpthumbof:
    <img src="[[*content:getImagesFromHtml=`1`:phpthumbof=`w=200`]]">


    get all images with width and high - information (if specified within html) as json-array
    [[*content:getImagesFromHtml]]


    result used with getImageList by MIGX - package:
    [[getImageList?
      &value=`[[*content:getImagesFromHtml]]`
      &tpl=`imageTpl`
    ]]
    


    placeholder availiable in tpl-chunk:
    [[+image]]
    [[+w]]
    [[+h]]
    


    example tpl-chunk:
    <div>
    <img src="[[+image:phpthumbof=`w=[[+w:default=`200`]]`]]">
    </div>


      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!