Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Louis 37 posts 59 karma points
    Mar 13, 2012 @ 10:30
    Louis
    0

    Image thumbnail

    HI all,

    I noticed in Umbraco if I upload an image, a thumbnail is generated, which is great! But....how do I access it in my XSLT file? I can access the main image fine but not the thumb nail as it as "_thumb" added to the end.

    Does anyone have any idea to help with this?

    Thanks

  • Ernst Utvik 123 posts 235 karma points
    Mar 13, 2012 @ 21:07
    Ernst Utvik
    0

    I guess you could do some string manipulation in the xslt to add the _thumb part to the filename as they are both stored in the same folder. The auto-generated thumb image is really only meant for the Umbraco backend and is not (to my knowledge) stored in the xml.

    For creating image thumbnails in your pages I recomend this great package: http://our.umbraco.org/projects/website-utilities/imagegen

    After installing the package the following snippet will produce a thumb with the longest side set to 100 px. Check documentation for more examples :)

    <img>
    <xsl:attribute name="src">/ImageGen.ashx?image=<xsl:value-of select="IMAGEALIAS"/>&amp;width=100&amp;height=100&amp;constrain=true</xsl:attribute>
    </img>
  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Mar 13, 2012 @ 21:37
    Bjarne Fyrstenborg
    0

    Hi Louis

    You can use ImageGen or Image Cropper if you want specific sizes of images, e.g. to crop an image to 100x100px

    When you specify thumbnail sizes for width/height in Upload datatype settings, it will resize from the largest proportion.. 
    You can get these generated thumbnails this way:

    <img src="{concat(substring-before(umbracoFile,'.'),'_thumb_250.jpg')}" alt="" />

    Where 250 is the (width/height) set in the settings.

    Bjarne 

Please Sign in or register to post replies

Write your reply to:

Draft