<div dir="ltr"><div><div>I&#39;m posting this here instead of the theme list because even though this would typically be needed in a theme, it&#39;s not about theming, per se.<br><br></div>I struggled [way too long] today to generate a full category breadcrumb. Yes, I know, this type of thing has been asked and answered ad nauseum.  The difference here is that the point at which I need the breadcrumb (eg grandparent category / parent category / category) is in a field template for a field that appears in the node display ... so long before $breadcrumb becomes available during the page render.<br>
<br></div>What I ended up with is the following. I do plan on moving the code, so no need to flame me on having it in the template. :-)  I&#39;d like to know if there&#39;s an easier way to do it ... &quot;Oh, you could have just called blah blah&quot; ... I promise not to cry... much.<br>
<br>    &lt;?php $parents = taxonomy_get_parents($variables[&#39;element&#39;][&#39;#object&#39;]-&gt;field_product_category[&#39;und&#39;][0][&#39;tid&#39;]); ?&gt;<br>    &lt;?php $breadcrumb = drupal_get_breadcrumb(); ?&gt;<br>
    &lt;?php foreach($parents as $parent): ?&gt;<br>      &lt;?php $breadcrumb[] = $parent-&gt;name; ?&gt;<br>    &lt;?php endforeach; ?&gt;<br>    &lt;?php $breadcrumb[] = $variables[&#39;element&#39;][&#39;#object&#39;]-&gt;field_product_category[&#39;und&#39;][0][&#39;taxonomy_term&#39;]-&gt;name; ?&gt;<br>
    &lt;?php print theme(&#39;breadcrumb&#39;, array(&#39;breadcrumb&#39;=&gt;$breadcrumb)); ?&gt;<br><br><br clear="all"><div><div><div><br>-- <br>---<div><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a></div>
<div><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a></div><div><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> / <a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a></div>
<div>@accidentalcoder</div>
</div></div></div></div>