Copied to clipboard

Flag this post as spam?

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


  • dominik 711 posts 733 karma points
    Mar 28, 2011 @ 13:10
    dominik
    0

    Slider with pagination (jQuery)

    hello,

    Ive got the following scenario:

    I just want to add a simple jQuery slider with Repeatable Custom Content - Now i need to increase the value of the pagination for each item.

    Here is my xslt:

    <xsl:template name="pagination">
      <div class="pagination">  
        <ul>
          <xsl:for-each select="$currentPage/self::* //homeSlider/items/item">
            <li><a href="#">1</a></li>
          </xsl:for-each>  
          </ul>
      </div>
    </xsl:template>      
        
    <xsl:template match="/">

      
    <!-- start writing XSLT -->

      
    <xsl:for-each select="$currentPage/self::* //homeSlider/items/item">
      <div class="home-header">     
            <div class="content">
              <xsl:call-template name="pagination"></xsl:call-template>
              <div class="text">
                <h5><xsl:value-of select="./data [@alias = 'homeHeadline']"/></h5>
                <xsl:value-of select="./data [@alias = 'homeSubHeadline']"/>
              </div>
          </div>  
      </div>
    </xsl:for-each>
    </xsl:template>

    The Value of the <li> Element should be dynamic 1 for the first slide and 2 for the second slide

     

  • Pasang Tamang 258 posts 458 karma points
    Mar 28, 2011 @ 13:21
    Pasang Tamang
    0

    Hi

    In this case one good option is using sort order.

    <li><a href="#"><xsl:value-of select="@sortOrder"/></a></li>
  • dominik 711 posts 733 karma points
    Mar 28, 2011 @ 13:25
    dominik
    0

    if I use this the value is empty

  • Pasang Tamang 258 posts 458 karma points
    Mar 28, 2011 @ 13:27
    Pasang Tamang
    0

    Value empty means @sortOrder?

  • dominik 711 posts 733 karma points
    Mar 28, 2011 @ 13:28
    dominik
    0

    Yes i get no value for @sortOrder it is just empty and not "1" "2"

  • Pasang Tamang 258 posts 458 karma points
    Mar 28, 2011 @ 13:31
    Pasang Tamang
    0

    Actually @sortOrder value comes from umbraco system which is used to sort the node in umbraco backend

  • dominik 711 posts 733 karma points
    Mar 28, 2011 @ 13:32
    dominik
    0

    yes but if i use your code i do not get anything back so it looks like @sortOrder is not working

  • Pasang Tamang 258 posts 458 karma points
    Mar 28, 2011 @ 13:57
    Pasang Tamang
    0

    Please check your xslt once. I tried in runway module with the below xslt and works fine

     

          <xsl:for-each select="$currentPage/ancestor-or-self::* //umbHomepage/umbTextpage">
            <li><a href="#"><xsl:value-of select="@nodeName"/><xsl:value-of select="@sortOrder"/></a></li>
          </xsl:for-each>  
          </ul>

    Thanks

     

  • dominik 711 posts 733 karma points
    Mar 28, 2011 @ 14:05
    dominik
    0

    Thanks, but i need the sort order from the Repeatable Custom Content. IN your case you are not using the Repeatable Custom Content extension I think

     

  • Pasang Tamang 258 posts 458 karma points
    Mar 28, 2011 @ 14:21
    Pasang Tamang
    0

    I think there should be something which is responsible for ordering the repeatable contents. may be @order cuz. I can see it's using sorrting in project image.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 28, 2011 @ 14:47
    Tom Fulton
    0

    Replied in your other thread - RCC doesn't have a sortOrder attribute but you can use position() to get the current position

  • dominik 711 posts 733 karma points
    Mar 28, 2011 @ 15:38
    dominik
    0

    now ive got another problem

    I got the following XSLT

    <xsl:template name="pagination">
      <div class="pagination">  
        <ul>
          <xsl:for-each select="$currentPage/self::* //homeSlider/items/item">
            <xsl:variable name="position" select="position()" />
              <li><a href="#" onclick="ShowDiv('{$position}')"><xsl:value-of select="$position"/></a></li>
          </xsl:for-each>  
          </ul>
      </div>
    </xsl:template>   

    So on every click i open a div with an id (position) and this works. But how can i hide all other divs instead of the one?
    I tried to use a HideDiv function but how can i tell it which divs i have to hide? for example if i write HideDiv('1') inside the onclick fucntion it works.

    Is there a way to automatically hide all divs instead of that i want to show?

    Thanks

  • dominik 711 posts 733 karma points
    Mar 28, 2011 @ 15:57
    dominik
    0

    ok i got it by using another variable called position-div

     

     

  • 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.

    Continue discussion

Please Sign in or register to post replies