Copied to clipboard

Flag this post as spam?

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


  • Natasha 79 posts 195 karma points
    Jan 16, 2013 @ 14:54
    Natasha
    0

    JQuery Cycle xslt

    Hello there

    I have a JQuery cycle slider which is working, however it's picking up all the images below the macro on the current page.  I would like it to pick up four images the user picks from the media files.  In the document type I have defined them as slide1-4 can anyone help with this.

    This is my XSLT

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">



       
        <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>
    <xsl:variable name="slides" select="umbraco.library:GetXmlNodeById($currentPage/@id)/* [starts-with(name(), 'slide')]/*"/>
       

    <xsl:template match="/">
      <xsl:value-of select="umbraco.library:RegisterJavaScriptFile('cycle', '/js/jquery.cycle/jquery.cycle.all.min.js')"/>
         <script type="text/javascript">
    $(document).ready(function() {
        $('#Carousel').cycle({
            fx: 'scrollHorz' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
               
        });
    });
        $(document).on("click", ".nextImg", function() {
       callNextInCycle();
    });
    </script>   
         <div id="Carousel">    
          <xsl:if test="$slides != '' and $slides != false() ">   
         
          <xsl:for-each select="umbraco.library:GetMedia($slides, 1)/@nodeName">
            <img src="{./umbracoFile}"/>
          </xsl:for-each>
         
          </xsl:if>
        </div>
     
      </xsl:template>

    </xsl:stylesheet>

    The url is http://upgrade.c4eo.org.uk/

    Thanks in advance

  • Nigel Wilson 939 posts 2061 karma points
    Jan 16, 2013 @ 19:32
    Nigel Wilson
    0

    Hi Natasha

    Try changing the following

    <xsl:for-eachselect="umbraco.library:GetMedia($slides, 1)/@nodeName">

    to this

    <xsl:for-eachselect="umbraco.library:GetMedia($slides, 0)/@nodeName">

    Hope this helps.

    Cheers, Nigel

  • Natasha 79 posts 195 karma points
    Jan 18, 2013 @ 15:45
    Natasha
    0

    HI Nigel

     

    Thanks for the suggestion, but it hasn't made a difference.  I am still working on it and will post the xslt if/when I get it working.

    Thanks, Natasha

  • Nigel Wilson 939 posts 2061 karma points
    Jan 22, 2013 @ 03:01
    Nigel Wilson
    0

    Hi Natasha

    You can try use the debugging functionality...

    Firstly, ensure in your web.config you have the umbracoDebugMode se to true:

    <add key="umbracoDebugMode" value="true"/>

    Then brwose to the page that isn't working and add the following to the URL:

    ?umbDebugShowTrace=true

     

    This might help you track down the offending line of code.

    Cheers, Nigel

  • 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