Copied to clipboard

Flag this post as spam?

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


  • Aditya Sabharwal 8 posts 38 karma points
    May 07, 2013 @ 19:49
    Aditya Sabharwal
    0

    Syntax for getting custom property of media image

    Hi ,I am trying to implement an image gallery with Image Gen and i am having trouble getting a custom prperty 'imageDescription' in the title of the <a> tag. Does any one know how to do this?my current XSLT look like this.<xsl:if test="number($mediaFolderId)">            <ul id="gallery">                <xsl:for-each select="umbraco.library:GetMedia($mediaFolderId, true())/Image">                    <xsl:if test="umbracoFile !=''">                        <li>                            <a href="{umbracoFile}" title="imageDescription" rel="gallery">                                                              <img src="/imageGen.ashx?image={umbraco.library:UrlEncode(umbracoFile)}&amp;width={$thumbWidth}&amp;height={$thumbHeight}" width="{$thumbWidth}" height="{$thumbHeight}" alt="{@nodeName}" title="{@nodeName}" class="thumbnail" />                                                          </a>                                                 </li>                    </xsl:if>                </xsl:for-each>            </ul>        </xsl:if>

  • Aditya Sabharwal 8 posts 38 karma points
    May 07, 2013 @ 19:56
    Aditya Sabharwal
    0

    Sorry for bad formatting. hope this one works

    <xsl:if test="number($mediaFolderId)">

         <ul id="gallery">

          <xsl:for-each select="umbraco.library:GetMedia($mediaFolderId, true())/Image">

              <xsl:if test="umbracoFile !=''">

                    <li>

                    <a href="{umbracoFile}" title="imageDescription" rel="gallery">

                           <img src="/imageGen.ashx?image={umbraco.library:UrlEncode(umbracoFile)}&amp;width={$thumbWidth}&amp;height=        {$thumbHeight}"  width="{$thumbWidth}" height="{$thumbHeight}" alt="{@nodeName}" title="{@nodeName}" class="thumbnail" />                                                                      </a>

                  </li>

               </xsl:if> 

          </xsl:for-each>   

             </ul> 

          </xsl:if>

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    May 07, 2013 @ 20:25
    Dennis Aaen
    100

    Hi Aditya,

    I think this will work for you.

    <xsl:if test="number($mediaFolderId)">
        <ul id="gallery">
            <xsl:for-each select="umbraco.library:GetMedia($mediaFolderId, true())/Image">
                <xsl:if test="umbracoFile !=''">
                    <li>
                        <xsl:element name="a">
                            <xsl:attribute name="href">
                                <xsl:value-of select="./umbracoFile" />
                            </xsl:attribute>
                            <xsl:attribute name="title">
                                <xsl:value-of select="./imageDescription" />
                            </xsl:attribute>
                            <xsl:attribute name="id">
                                <xsl:text>gallery</xsl:text>
                            </xsl:attribute>
                            <img src="/imageGen.ashx?image={umbraco.library:UrlEncode(umbracoFile)}&amp;width={$thumbWidth}&amp;height=        {$thumbHeight}"  width="{$thumbWidth}" height="{$thumbHeight}" alt="{@nodeName}" title="{@nodeName}" class="thumbnail" />
                        </xsl:element>
                    </li>

                </xsl:if>
            </xsl:for-each>
        </ul>
    </xsl:if>

    /Dennis

  • Aditya Sabharwal 8 posts 38 karma points
    May 07, 2013 @ 21:28
    Aditya Sabharwal
    0

    Thanks alot. It works!!!

     

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    May 07, 2013 @ 21:35
    Dennis Aaen
    0

    Hi Aditya,

    Great to hear that.

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft