title: Magento display all categories on product view page with parent categories
body: <p>Following on from this question: <a href="https://stackoverflow.com/questions/4252547/display-all-categories-that-a-product-belongs-to-in-magento">Display ALL categories that a product belongs to in Magento</a></p>
  
  <p>Is there a way to display the full category path (with links at each stage) rather than only displaying the final category that a product belongs to?</p>
  
  <p>I have this code so far...</p>
  
  <pre><code>&lt;?php
              $currentCatIds = $_product-&gt;getCategoryIds();
              $categoryCollection = Mage::getResourceModel('catalog/category_collection')
                   -&gt;addAttributeToSelect('name')
                   -&gt;addAttributeToSelect('url')
                   -&gt;addAttributeToFilter('entity_id', $currentCatIds)
                   -&gt;addIsActiveFilter();
              foreach($categoryCollection as $cat){
              ?&gt;
                  &lt;a href="&lt;?php echo $cat-&gt;getUrl(); ?&gt;"&gt;
                      &lt;?php echo $cat-&gt;getName() ?&gt;
                  &lt;/a&gt;
              &lt;?php } ?&gt;
  </code></pre>
  
  <p>Which correctly links the category name that is displayed on the page.
  What I would like is to display the full Cat > Sub Cat > Sub Sub Cat trail, and have each element in that trail correctly linked.</p>