Copied to clipboard

Flag this post as spam?

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


  • Brian Coyle 9 posts 39 karma points
    May 01, 2013 @ 16:19
    Brian Coyle
    0

    @nodeName image title in XSLT file?

    I'm using a simple image gallery macro using Imagegen (thanks Doug :)), and it works really well.

    The image thumbs are pulled into a <ul> - <li> and I would like to add a dynamic title beneath each, i'm assuming @nodeName is used to this effect. Could someone suggest the correct xslt syntax to achieve this? My umbraco skills are limited so any help would be appreciated.

    Many thanks

    Brian - (snippet below).

     <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="{@nodeName}" 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>
                              
                      
                                <p> IMAGE TITLE HERE</p>
                              
                            </li>
                        </xsl:if>
                    </xsl:for-each>
                </ul>

            </xsl:if>

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    May 01, 2013 @ 16:25
    Chriztian Steinmeier
    101

    Hi Brian,

    You use the value-of instruction to do that, like this:

    <p><xsl:value-of select="@nodeName" /></p>

    /Chriztian

  • Brian Coyle 9 posts 39 karma points
    May 01, 2013 @ 16:38
    Brian Coyle
    0

    Awesome, thanks Chriztian.

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

    Hi ,

    I am implementing a gallery the same way brian is doing. The only difference that I want a custom property of media to be part of the title of the <a> tag.

    I am not able to get the exact syntax for that. Can anyone help?

    my XSLT looks like

     <a href="{umbracoFile}" title="ValueOfCustomProperty" 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" />

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    May 07, 2013 @ 20:27
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies