Hello,

Thank you for this great module... I seeked a long time for such a feature...

Thus I will ask you and the community for some improvements, considering your will and possibilities:

This one seems minor but I still need it: bringing back the onmouseover caption on terms, which usually displaies the description of the terms (check the screenshot called a_drupal_axo_term_caption.png for precisions about what I mean by caption). Apparently, Term_display does not handle it yet.

CommentFileSizeAuthor
a_drupal_axo_term_caption.png3.97 KBdoc2@drupalfr.org
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nedjo’s picture

I see the point. Personally I've never been happy with the term description field. What is it for? If it's only for a title attribute, that should be clear. There are many uses that would make it inappropriate (e.g., too long) for a title.

doc2@drupalfr.org’s picture

I see. Thank you for this clear answer.

doc2@drupalfr.org’s picture

joachim’s picture

This is doable with theming and the load option.

psobrino’s picture

Hello,

I write a little code in term_display.module that make a similiar function: display the term description below the custom display of term(s).

I need use this for the vocabulary "Author", where description field is a biography for the writer of the article. See my site (http://www.herramienta.com.ar) for the results.

(sorry for my english)

/**
 * Theme terms as a comma-separated list.
 *
 * Old function:
 * function theme_term_display_custom($vocabulary, $terms) {
 *   $links = array();
 *   foreach($terms as $term) {
 *     $links[] = l($term->name, taxonomy_term_path($term));
 *   }
 *   return '<h3 class="title">' . check_plain($vocabulary->name) .': '. implode(', ', $links) .'</h3>';
 * 
 * }
 * 
 * 
 * New function (psobrino):
 */

function theme_term_display_custom($vocabulary, $terms) {
  $links = array();
  $descriptions = array();
  foreach($terms as $term) {
    $links[] = l($term->name, taxonomy_term_path($term));
    $descriptions[] = $term->name . '. ' . $term->description;
  }
  return '<h3 class="title">' . check_plain($vocabulary->name) .': '. implode(' - ', $links) .'</h3><p class="term-description"><i>' . implode('<br>', $descriptions) .'</i></p>';

}

joachim’s picture

Hi psobrino.
The idea of theme functions is that you can override them in your theme's template.php, and thus customize what they do without altering the module.
Check the theme guide for more information on how this works.

Once you've done that, perhaps you've like to add your custom function to our documentation page?

psobrino’s picture

Hi joachim.

Thanks for you correction! I'm new in Drupal and not know very well the correct form of coding...

I take your suggestion and move the new code to the template.php file of my theme and work fine!

And of course, I really like to add this (very little) code to documentation when I have time for it (in this week).

Thanks again for this usefull module.

rstamm’s picture

hi psobrino,

it's important to use check_plain() or filter_xss_admin() in your code to prevent security holes.

e.g.

... implode('<br>', check_plain($descriptions)) ...
rstamm’s picture

Category: feature » support