</div> </div> <?php } ?> <?php if (isset($entity->field_section_new[$entity->language])) { print '<pre>'; foreach ($entity->field_section_new[$entity->language] as $tid) { $term = taxonomy_term_load($tid); // load term object $term_uri = taxonomy_term_uri($term); // get array with path $term_title = taxonomy_term_title($term); $term_path = $term_uri['path']; $link = l($term_title, $term_path); print '$term ' . $term . '<br />'; print '$term_uri ' . $term_uri . '<br />'; print '$term_title ' . $term_title . '<br />'; print '$term_path ' . $term_path . '<br />'; print '$link ' . $link . '<br />'; print_r($term_uri); } print '</pre>'; } ?>
/** * Return a themed breadcrumb trail. * * @param $breadcrumb * An array containing the breadcrumb links. * @return a string containing the breadcrumb output. */ function burzenski_breadcrumb($variables) { $breadcrumb = $variables['breadcrumb']; $breadcrumb[] = l(drupal_get_title(), $_GET["q"]); //die(var_dump($breadcrumb)); //die(var_dump($breadcrumb)); if (!empty($breadcrumb)) { $output = '<ul>'; $first = true; foreach ($breadcrumb as $key => $value) { $string = $value; $value = htmlspecialchars_decode($string); $copy_1 = $value; $copy_2 = $value; if ($first) { $output .= '<li>' . $value . '</li>'; $first = false; } else { $next = false; if (strpos($value, '/blog/all') !== false) { //-> Tiene la cadena //-> Verificamos si es All if (strpos($value, 'blog/all">Blog') !== false || strpos($value, '/blog/all"') !== false) { //-> Procesamos este enlace $term_title = "All"; $pos = strpos($value, ">"); $innerText = substr($value, $pos + 1, strlen($value) - $pos - 5); $newValue = $term_title; $value = str_replace($innerText, $newValue, $value); $output .= '<li>></li><li>' . decode_entities($value) . '</li>'; } else { //-> Tomamos el termino id y buscamos el nombre if (strpos($value, '/blog/all/') !== false) { $tid = str_replace('blog/all/', "", $_GET["q"]); $term = taxonomy_term_load($tid); // load term object $term_uri = taxonomy_term_uri($term); // get array with path $term_title = ucfirst(taxonomy_term_title($term)); if (!empty($term_title)) { $pos = strpos($value, ">"); $innerText = substr($value, $pos + 1, strlen($value) - $pos - 5); $newValue = $term_title; $value = str_replace($innerText, $newValue, $value); $output .= '<li>></li><li>' . decode_entities($value) . '</li>'; } else { $next = true; } } else { $next = true; } } } else { $next = true; } if ($next) { $pos = strpos($value, ">"); $innerText = substr($value, $pos + 1, strlen($value) - $pos - 5); if (strlen($innerText) > 45) { $newValue = substr($innerText, 0, 42) . "..."; $value = str_replace($innerText, $newValue, $value); } $output .= '<li>></li><li>' . decode_entities($value) . '</li>'; } } } $output .= '</ul>'; return $output; } }