Copied to clipboard

Flag this post as spam?

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


  • Sam 63 posts 126 karma points
    Jul 07, 2011 @ 13:45
    Sam
    0

    Retrieve content from sub sub nav

    Hi all,

    I have my site structure like this :

    Content
      default
          link1
          link2
             Cat 1
                 Item 1.1
                 Item 1.2
             Cat 2
                 Item 2.1
                 Item 2.2
           link3  etc...

     

    Under cat 1 I have a slider to list item1.1, item 1.2 etc...same for each categories.

    I don't quite figute how to write the xslt and thus create one macro to select the items under each sub nodes to put in the slider..

     

    Any help out there?

    thks,

    //Sam

     

     

  • Rich Green 2246 posts 4008 karma points
    Jul 07, 2011 @ 13:49
    Rich Green
    0

    Hey Sam,

    Not sure I fully understand.

    To clarify, when you're on the Cat 2 page you want your slider to show Item 1.1 & Item 1.2?

    Or you want the slider to show all categories when you're on the home page?

    Rich

  • Sam 63 posts 126 karma points
    Jul 07, 2011 @ 14:06
    Sam
    0

    Rich,

    When i,m on page cat 1 the sliders show all the nodes under cat 1 that is Item1.1, Item 1.2 and when i'm on page Cat 2 the slider shows the nodes under that cat (Item 2.1, Item 2.2)

    Does this seem clear for you?

     

    //Sam

  • Rich Green 2246 posts 4008 karma points
    Jul 07, 2011 @ 14:39
    Rich Green
    0

    Hey Sam,

    Ok, this code will list the nodes, you just need to edit it for your needs.

    <ul>
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
      <li>
        <href="{umbraco.library:NiceUrl(@id)}">
          <xsl:value-of select="@nodeName"/>
        </a>
      </li>
    </xsl:for-each>
    </ul>

    fyi it's taken from the default "List Sub Pages from Current Page" xslt template that you can choose when creating a new xslt file in Umbraco.

    Rich 

  • Sam 63 posts 126 karma points
    Jul 08, 2011 @ 08:00
    Sam
    0

    What's up Rich ?

    Yeah I have been able to figure it out, I was using the wrong xslt template..thanks... by the way I have another question...my slideshow users some sort of bullet paging which I must increment manually with the known number of slides...how can I do thatdynamically in xslt, that is increment this number to match number of nodes...

     

    Here is my xslt :

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

      
     <div class="jflow-content-slider">
       <div id="slides">
         <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
         <!--to repeat--> 
            <div class="slide-wrapper">
                 <div class="slide-details">
                   img src="{projectPhoto}" width="850" height="380" alt="{@nodeName}" /> 
                 <div class="clear"></div
            </div>
           <!--end of repeating element -->     
           
         </xsl:for-each

       </div>
         <!-- end of slides -->            
            
            <div id="myController">
                   <span class="jFlowPrev">previous</span>

                    HERE I MUST ADD SPAN CLASSE USING XSLT WITH INCREMENT NUMBERS (1,2,3 etc..)according to number of nodes(Item1.1,1.2 etc..) under CAT 1
                    <span class="jFlowControl">1</span>
                    <span class="jFlowControl">2</span>

                   ---------------
                  <span class="jFlowNext">view next project</span>

              </div>
                  
             </div>   
                      

    </xsl:template>

    I was wondering if i could use the count feature..

    Any idea?

    //Sam

     

     

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Jul 08, 2011 @ 08:22
    Chriztian Steinmeier
    0

    Hi Sam,

    Just run through the same set again, using position() to output the number:

    <xsl:for-each select="$currentPage/*[@isDoc][not(umbracoNaviHide = 1)]">
        <span class="jFlowControl">
            <xsl:value-of select="position()" />
        </span>
    </xsl:for-each>

    EDIT: Just saw that's not exactly what you need - but I'll take a closer look and update this...

    /Chriztian

  • Sam 63 posts 126 karma points
    Jul 08, 2011 @ 09:03
    Sam
    0

    Ok Chriztian..await this..trying some testings on my side.

    //Sam

  • Sam 63 posts 126 karma points
    Jul 08, 2011 @ 14:21
    Sam
    0

    Hi Chriztian, have been able to figure out how to repeat number of span according to number of nodes with this xslt

                           <div id="myController">
                                <span class="jFlowPrev">previous</span>
                                 <xsl:if test="count($nodes)">
                                   <xsl:for-each select="$nodes">
                                  <span class="jFlowControl">1</span>  // need to increment this number here with a kinda loop.
                                    </xsl:for-each
                               </xsl:if>
                                <span class="jFlowNext">view next project</span>
                            </div>

    Now i need to increment the numbers according to number of slides almost like a paging...got quite stuck on this one...any advice

    //Sam

  • Sam 63 posts 126 karma points
    Jul 08, 2011 @ 14:30
    Sam
    0

    Chriztian Just needed to put <xsl:value-of select="position()" /> like you advice to putpu the numbers.

    Final xslt

    <div id="myController">
                                <span class="jFlowPrev">previous</span>
                                 
                                   <xsl:for-each select="$nodes">
                                  <span class="jFlowControl"><xsl:value-of select="position()" /></span>
                                    </xsl:for-each
                               
                                <span class="jFlowNext">view next project</span>
                            </div>

    Works ok now.

     

Please Sign in or register to post replies

Write your reply to:

Draft