6 Replies Latest reply: Nov 2, 2012 4:41 AM by RMishra RSS

    Breadcrumb

    Raghuram A
      Hi,
      how to add breadcrumb to an jsp page?
        • 1. Re: Breadcrumb
          Praveer.Rai
          Hi,

          Mostly two types of breadcrumbs are used :

          1- Based on menu/catalog.
          2- based on user journey.

          You can install CRS module and see its jsp - \CommerceReferenceStore\Store\Storefront\j2ee-apps\Storefront\store.war\navigation\gadgets\breadcrumbs.jsp


          You can also refer below links that mention components that you can use :

          http://docs.oracle.com/cd/E23095_01/CRS.93/ATGCRSOverview/html/s0204historicalnavigation01.html
          http://www.scribd.com/doc/82574621/105/Navigation-History-and-Breadcrumbs
          http://docs.oracle.com/cd/E23095_01/Platform.93/apidoc/atg/repository/servlet/NavHistoryCollector.html


          ~ Praveer
          • 2. Re: Breadcrumb
            333
            hi,
            <dsp:importbean bean="/atg/dynamo/droplet/ForEach" />
                 <dsp:importbean bean="/atg/commerce/catalog/CatalogNavHistoryCollector" />
                 <dsp:importbean bean="/atg/commerce/catalog/CatalogNavHistory"/>
                 <dsp:droplet name="CatalogNavHistoryCollector">
                      <dsp:param name="navAction" param="navAction" />
                      <dsp:param name="navCount" param="navCount" />
                      <dsp:param name="item" param="element" />
                 </dsp:droplet>

                 <dsp:droplet name="ForEach" var="fe">
                      <dsp:param bean="CatalogNavHistory.navHistory" name="array" />

                      <dsp:oparam name="output">
                           <c:choose>

                                <c:when test="${fe.count lt fe.size}">
                                     <dsp:a href="displayCategory.jsp">
                                          <dsp:valueof param="element.displayName" />
                                          <dsp:param name='id' param='element.repositoryId' />
                                          <dsp:param name='navAction' value='pop' />
                                          <dsp:param name='navCount'
                                               bean='/atg/commerce/catalog/CatalogNavHistory.navCount' />

                                     </dsp:a>

            >
                                </c:when>
                                <c:otherwise>
                                     <dsp:valueof param="element.displayName" />
                                </c:otherwise>


                           </c:choose>
            </dsp:oparam></dsp:droplet>
            • 3. Re: Breadcrumb
              Raghuram A
              Hi,
              id gone through that breadcrumb.jsp file and i got the logic ... my question is how to include that in a page . and thank for the reply.
              • 4. Re: Breadcrumb
                RMishra
                supose you want to add in category_page (generic_category.jsp) and above code file name is breadCrumbs.jsp then:

                generic_category.jsp::
                <html><body>
                ......................
                ........................
                <dsp:droplet name="CategoryLookup">
                     <dsp:param name="id" param="itemId"/>
                     <dsp:param name="elementName" value="parentCategory"/>
                     <dsp:oparam name="output">
                          <%-- Create Breadcrumb Trail --%>
                          <dsp:droplet name="CatalogNavHistoryCollector">
                               <dsp:param name="*item*" param="parentCategory"/>
                               <dsp:param name="*navAction*" param="navAction"/>
                               <dsp:param name="*navCount*" bean="CatalogNavHistory.navCount"/>
                          </dsp:droplet>
                          <!-- Send Item View Notification -->
                          <dsp:droplet name="CategoryBrowsed">
                               <dsp:param name="eventobject" param="element"/>
                          </dsp:droplet>
                <%-- history link -->
                <dsp:valueof param="element.displayName"/>
                          
                          <%-- Display Child Categories as links --%>
                          <dsp:droplet name="/atg/dynamo/droplet/ForEach">
                               <dsp:param name="array" param="parentCategory.fixedChildCategories"/>
                               <dsp:param name="elementName" value="childCategory"/>
                               <dsp:oparam name="output">
                                    <dsp:getvalueof id="templateURL" idtype="java.lang.String" param="childCategory.template.url">
                                         <dsp:a href="generic_category.jsp">
                                                   <dsp:param name="id" param="childCategory.repositoryId"/>
                                                   <dsp:valueof param="childCategory.displayName"/>
                                                   <!-- Add navigation information to link -->
                                                   <dsp:param name="*navAction*" value="push"/>
                                         </dsp:a>
                                    </dsp:getvalueof>     
                               </dsp:oparam>
                          </dsp:droplet>
                          
                          <%-- Display Child Products as links --%>
                          <dsp:droplet name="/atg/dynamo/droplet/ForEach">
                               <dsp:param name="array" param="parentCategory.fixedChildProducts"/>
                               <dsp:param name="elementName" value="childProduct"/>
                               <dsp:oparam name="output">                    
                                    <dsp:getvalueof id="templateURL" idtype="java.lang.String" param="childProduct.template.url">
                                         <dsp:a href="generic_product.jsp">
                                                   <dsp:param name="itemId" param="childProduct.repositoryId"/>
                                                   <dsp:valueof param="childProduct.displayName"/>      
                                                   <IMG src='<dsp:valueof param="childProduct.smallImage.url"/>' />
                                                   
                                                   <!-- Add navigation information to link -->
                                                   <dsp:param name="*navAction*" value="push"/>
                                                   <dsp:param bean="CatalogNavHistory.navCount" name="*navCount*"/>
                               </dsp:a>                    
                                    </dsp:getvalueof>
                               </dsp:oparam>
                          </dsp:droplet>          
                     </dsp:oparam>
                </dsp:droplet>
                ....................
                ...................
                </body></html>
                -RMishra

                Edited by: RMishra on Nov 2, 2012 1:51 PM

                Edited by: RMishra on Nov 2, 2012 2:25 PM
                • 5. Re: Breadcrumb
                  Raghuram A
                  Ok got it .thank you.
                  • 6. Re: Breadcrumb
                    RMishra
                    Same way for product page:
                    generic_product.jsp:
                    ................
                    <dsp:droplet name="/.............../ProductLookup">
                    <dsp:param bean="/OriginatingRequest.requestLocale.locale" name="repositoryKey"/>
                    <dsp:param name="elementName" value="Product"/>
                    <dsp:oparam name="output">

                    <%-- Add this product to the user's list of products browsed. --%>
                    <dsp:droplet name="/atg/commerce/catalog/ProductBrowsed">
                    <dsp:param name="eventobject" param="Product"/>
                    </dsp:droplet>
                    <%-- display breadCrumb --%>
                    <dsp:include page="breadCrumbs.jsp"/>
                    ............
                    ...............
                    -RMishra