How to put taxonomy description into taxonomy views page?

Created on 28 January 2011, over 13 years ago
Updated 11 April 2019, about 5 years ago

I know that if one knows how to write php code, then you can put a snippet in the header of your taxonomy view to display the related taxonomy description. I found this snippet of code for 6.x-3.0, but it doesn't work for 7.x.

<?php
$tid = arg(2);
$term = taxonomy_get_term($tid);
if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($term->vid) == I18N_TAXONOMY_LOCALIZE) {
  $description = i18nstrings("taxonomy:term:$term->tid:description", $term->description);
}
else {
  $description = $term->description;
}
print $description;
?>

Can anyone help me adapt this for Drupal 7?

Or does anyone know of a different way to display the taxonomy's description at the top the that particular term's page?

πŸ’¬ Support request
Status

Fixed

Version

3.0

Component

Miscellaneous

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States nelslynn

    Nothing is working for me here and I believe it's because my taxonomy term page is 2 deep. For example, I'm trying to display the description on a term page structure like catalog/main-term/sub-term (catalog/%/%). I want the description of the last term in the URL.

    I hope this makes sense. I've searched all over for a solution and come up empty. If anyone has some incite, I'm all ears. Thx

Production build 0.69.0 2024