Copied to clipboard

Flag this post as spam?

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


  • srihari 4 posts 24 karma points
    Nov 28, 2012 @ 12:04
    srihari
    0

    Help with creating hierarchy of items using XSLT

    Hi

    I know many examples are available but I was still  stuck something simple which is taking me like 4days  and still cant figure it out.

    I need to create a image gallery with light box which is very straight forward with the examples given but I need to create gallery with 2 levels.

    Collection  (Page level 1)

    --- Fabric Collection Gallery  (Doctype contains thumb and pop-up image) (Page level 2)

     --- Fabric Collection Gallery2  (Doctype contains only pop-up image)(Page level 3)

    This was more similar to runaway template gallery but they have to open in the same page not in 2 pages.

    To do this I need to load 2 document types in 2 page levels.

    First level Fabric Collection Gallery is coming up fine. (inside template match) 

    collectionGallery.xslt

    <ul id="ts-display-pf-col-3" class="collectionPageUL">

    <xsl:for-each select="$currentPage/*[@isDoc]">

                <!-- display each image in the row -->

                <li><ul id="inner-ts-display-pf-col" class="inner-ts-display-pf-col-{@id}">

    <li><a href="{current()/PopupImage}" class="lightbox image" title=" {current()/ThumbnailTitle}" heading="" desc="">                                           <img src="{current()/ThumbnailImage2}" alt=""  class="scale-with-grid PageImage2"/></a>                                </li>

      </ul>                               </li>

    </xsl:for-each> 

    </ul>

    Which is showing fine the thumbnails and its pop-up images.

    Now I need to load the second document type with only pop-up images into the same page and for this Im using this code

    collectionGallery2.xslt

    <ul class="pressListPhotosUL3">

    <xsl:for-each select="$currentPage/*[@isDoc]">

    <li><a href="{current()/pressPopupImage2}" title="{current()/pressPopupImageTitle2}" heading="" desc=""></a></li>

            </xsl:for-each> 

    </ul> 

    which is not showing anything and is returning .. <li><a href title heading desc></a></li>

    I doubt something about <xsl:for-each select="$currentPage/*[@isDoc]"> in the  second xslt file. I think it should be something else


    More Details about the output

    The output before the page loads should be like this

    <ul class="lightboxgroups"><li>

    <ul class="fab1"><li> Fabric collection Gallery 1 picture1 (opens lightbox popup)</li></ul>

    </li>

    <li>

     <ul class="fab2"><li> Fabric collection Gallery 2 picture1 (opens lightbox popup)</li></ul>

    </li>

    </ul>

     

    In the same page somewhere at the bottom it should load the 2 level which will be 

    <ul class="fab1">

    <li><Fabric Collection Gallery 1 picture2</li>

    <li><Fabric Collection Gallery 1 picture3</li>

    </ul>

     

    <ul class="fab2">

    <li><Fabric Collection Gallery 2 picture2</li>

    <li><Fabric Collection Gallery 2 picture3</li>

    </ul>

    Usign Jquery I m going to add them to the level 1 <ul> with same class name and the Jquery lightbox will treat each <li> as a group and loads them into Pop-up.
    Once the page was loaded  it will show as 

    <ul class="lightboxgroups"><li>

    <ul class="fab1">

    <li> Fabric collection Gallery 1 picture1 ( will have thumb opens lightbox popup)</li>

    <li> Fabric collection Gallery 1 picture 2 ( won't have thumb opens lightbox popup)</li>

    <li> Fabric collection Gallery 1 picture 3 ( won't have thumb opens lightbox popup)</li>

    </ul>

    </li>

    <li>

     <ul class="fab2">

    <li> Fabric collection Gallery 2 picture1 (will have thumb opens lightbox popup)</li>

    vice-versa..

    </ul>

    </li>

    </ul>

     

    Now I call Jquery as $(".lightboxgroups li").each(function(){ $(this).lightbox() });

    Thanks 

    Harry

  • srihari 4 posts 24 karma points
    Nov 28, 2012 @ 18:06
    srihari
    0

    Hi Can anyone please help with my issue of creating/adding  multiple datatypes to the same page using 2 page/node levels. 

  • Charles Afford 1163 posts 1709 karma points
    Jan 08, 2013 @ 22:45
    Charles Afford
    0

    Hello are you still having issues with this?

  • Charles Afford 1163 posts 1709 karma points
    Jan 08, 2013 @ 22:59
    Charles Afford
    0

    Hello are you still having issues with this?  The problem is that you are searching on the same level for the PopupImage and the pressPopupImage where you need to be searching a level lower down for the pressPopupImage.  Also with the xslt inside the foreach loop where you have current()/propertyname, you dont need the current() as its already in context within the for each loop,

    Not sure if this makes sense, if not then post back and i will explain it in more detail and help you out with the xslt.  Thanks.  Charles  

     

     

Please Sign in or register to post replies

Write your reply to:

Draft