Essential ATG Dynamo Training - Got atg Certified Relationship Management Developer?
This is not an official ATG site: ATG, Dynamo, Scenario Server and Personalization Server are trademarks or registered trademarks of Art Technology Group
Articles Exercises Resources Links Search

ShowBreadcrumbs.jhtml

This is the include which actually renders the breadcrumbs links into the page. It's a foreach through the navHistory array. Adding links to the CategoryPage with the navCount appropriately set and the pop navAction set.

<!-- Title: Show Breadcrumbs Page -->

<DECLAREPARAM NAME="pageType" CLASS="java.lang.String"
              DESCRIPTION="Are we showning a 'category' or 'product' page?">

<JAVA>
/*
     Before this point the CatalogNavHistoryCollector should have been called
     to update the CatalogNavHistory component with the current category
     RepositoryItem and details passed to it from the previous page using the
     URL parameters.

     We will now list the names of each category held by the CatalogNavHistory
     component and create a link to the Category page that will display them.
     Passed through these links are the parameters "itemId" which holds the
     category repositoryId, "navAction" set with the value of "pop" (which
     indicates that the CatalogNavHistory should clear its stack and rebuild
     it using the default parent category property), and "navCount" which holds
     the index for each category element from the CatalogNavHistory.navHistory
     array.

     The "pageType" parameter passed to this page fragment is used to indicate
     what type of page is calling this fragment. If this page fragment is
     called from a category page we will not link the last category entry
     held by the CatelogNavHistory component. However, if this page fragment
     is called from a product page, we will link the last entry, as it
     represents the PARENT category page to the current product page.
*/
</JAVA>
<droplet bean="/atg/dynamo/droplet/ForEach">
  <param name="array" value="bean:/atg/commerce/catalog/CatalogNavHistory.navHistory">
  <oparam name="output">
    <droplet bean="/atg/dynamo/droplet/Switch">
      <param name="value" value="param:count">
      <oparam name="param:size">
        <droplet bean="/atg/dynamo/droplet/Switch">
          <param name="value" value="param:pageType">
          <oparam name="product">
            <a href="CategoryPage.html">
              <param name="itemId" value="param:element.repositoryId">
              <param name="navAction" value="pop">
              <param name="navCount" value="param:index">
              <valueof param="element.displayName"></valueof>
            </a>
          </oparam>
          <oparam name="default">
            <valueof param="element.displayName"></valueof>
          </oparam>
        </droplet>
      </oparam>
      <oparam name="default"> 
        <a href="CategoryPage.html">
          <param name="itemId" value="param:element.repositoryId">
          <param name="navAction" value="pop">
          <param name="navCount" value="param:index">
          <valueof param="element.displayName"></valueof>
        </a>
      </oparam>
    </droplet>
  </oparam>
</droplet>


Technical Training Advertise your Training Programs for Free! Los Angeles Web Design Shopping Cart Software  Form a Corporation