Copied to clipboard

Flag this post as spam?

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


  • Anders Dahl Tollestrup 73 posts 52 karma points
    Dec 12, 2009 @ 10:52
    Anders Dahl Tollestrup
    0

    Using media thumbnail in XSLT

    Hi

    Is it possible to access to auto-generated image thumbnail through the GetMedia function. Maybe through an umbracoThumbnail alias ??

    [code]
    <xsl:variable name="media" select="umbraco.library:GetMedia(data[@alias='pImage'], 'false')/data" />
    <xsl:if test="$media">
      <xsl:variable name="url" select="$media [@alias = 'umbracoFile']" />
      <xsl:variable name="width" select="$media [@alias = 'umbracoWidth']" />
      <xsl:variable name="height" select="$media [@alias = 'umbracoHeight']" />
      <xsl:variable name="altText" select="@nodeName" />
      <a href="{umbraco.library:NiceUrl(@id)}" title="Læs mere ...">
        <img src="{$url}" width="120px" height="90px" alt="{$altText}" />
      </a>
    </xsl:if>
    [/code]

    Kind regard,
    /Anders

  • Fredrik 6 posts 22 karma points
    Dec 12, 2009 @ 12:16
    Fredrik
    0

    Hi

    In this way, I have solved it in my gallery.

    <xsl:variable name="galImage" select="umbraco.library:GetMedia($picFile,0)/data[@alias='umbracoFile']"/>
    <xsl:variable name="extension" select="umbraco.library:GetMedia($picFile,0)/data[@alias='umbracoExtension']"/>
    ...

    <img src="{concat(substring-before($galImage, concat('.',$extension)), concat('_thumb.',$extension))}" alt="{@nodeName}"/>

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Dec 13, 2009 @ 13:29
    Douglas Robar
    0

    If you need more flexibility in your creation of thumbnails (various sizes, cropping, borders, etc. etc.) you might find ImageGen helpful. http://our.umbraco.org/projects/imagegen. Full docs as well.

    There are also a number of packages for galleries that can save you time.

    cheers,
    doug.

Please Sign in or register to post replies

Write your reply to:

Draft