Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 14, 2011 @ 13:44
    Fuji Kusaka
    0

    Display a single url to trigger a slideshow

    Hi all,

    Can someone help on how i can trigger a slideshow with a single link. What i need to do is get all the images from my media but not displaying them but instead just a single link to get the slideshow to work.

      <xsl:if test="number($restoSlideshow)">
            <xsl:for-each select="umbraco.library:GetMedia($restoSlideshow, 'true')/Image">
                <href="{umbracoFile}">
                 <xsl:attribute name="rel">
                      <xsl:value-of select="string('lux-slideshow')"/>
                 </xsl:attribute>                      
              View Slideshow   
             </a>           
        </xsl:for-each>   
    </xsl:if>

     

    Here "View Slideshow will repeat depending on number of image". How can i possibly display a single link instead?

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Nov 14, 2011 @ 14:15
    Michael Latouche
    0

    Hi Fuji,

    There are many ways of doing, depending on the UI you wish to get... The most simple probably : you can load all your images in an invisible div, and then have one single link "View Slideshow" which, when clicked, would trigger a client-side event that would make the div visible.

    Hope this helps.

    Cheers,

    Michael.

  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 14, 2011 @ 20:11
    Fuji Kusaka
    0

    May be i should only display the url of the first Image which will eventually trigger the slideshow.

    Is that possible, that is display only the url of the first Image in a media folder ?

    Any suggestion?

  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 14, 2011 @ 21:01
    Fuji Kusaka
    0

    I managed to get the url of the first Image to trigger the slideshow but somehow am getting an extra image. The first image is displaying twice.

    Here is my xslt

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

            <xsl:for-each select="umbraco.library:GetMedia($restoSlideshow, 'true')/Image">                
              <a href="{umbracoFile}">
                 <xsl:attribute name="rel">
                      <xsl:value-of select="string('trig-slideshow')"/>
                 </xsl:attribute>          
                 <xsl:attribute name="title">
                   <xsl:value-of select="@nodeName"/>
                 </xsl:attribute>
                   
             </a>
          
             </xsl:for-each>
          <xsl:call-template name="urlChildImg" />    
           
    </xsl:if>

    </xsl:template>
        
       <xsl:template name="urlChildImg">     
         <a href="{umbraco.library:GetMedia($restoSlideshow, 'true')/Image[1]/umbracoFile}" rel="trig-slideshow">  
              View Slideshow
              </a>  
        </xsl:template>
  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 15, 2011 @ 03:25
    Fuji Kusaka
    0

    Any suggestion?

  • Paul Blair 466 posts 731 karma points
    Nov 15, 2011 @ 05:23
    Paul Blair
    0

    if you only want to display 1 link you can put this test inside your for loop:

    <xsl:if test="position() = 1">
       <a href.....
       </a>
    </xsl:if>

  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 15, 2011 @ 06:07
    Fuji Kusaka
    0

    Hi Paul yes obviously.....what was i thinking of....

    <xsl:if test="number($restoSlideshow)">   
         
            <xsl:for-each select="umbraco.library:GetMedia($restoSlideshow, 'true')/Image">
              
              <xsl:choose>
              <xsl:when test="position() = 1">
                  <href="{umbraco.library:GetMedia($restoSlideshow, 'false')/Image[1]/umbracoFile}" rel="trig-slideshow" title="{@nodeName}"
                        View Slideshow          
                        </a
              
                </xsl:when>
              <xsl:otherwise>
                     <href="{umbracoFile}">
                                 <xsl:attribute name="rel">
                                    <xsl:value-of select="string('trig-slideshow')"/>
                                 </xsl:attribute>          
                                 <xsl:attribute name="title">
                                   <xsl:value-of select="@nodeName"/>
                                 </xsl:attribute>
                                 <xsl:text</xsl:text>
                             </a>    
                </xsl:otherwise>
    </xsl:choose>
Please Sign in or register to post replies

Write your reply to:

Draft