Option to include taxonomy image display, for subterm context, if the taxonomy image module is available

mcreature - January 16, 2008 - 18:52
Project:Taxonomy context
Version:6.x-2.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:NancyDru
Status:closed
Description

It would be great if their was an option to include "taxonomy images display, in the sub-term context, if the taxonomy image module is available.

The Glossary module added this feature recently, and the taxonomy list module does a nice job of this also, though only while viewing all terms in the vocabulary, or vocabularies at once, not just the sub-terms from the term the user is viewing.

Thanks for this great module.

#1

nedjo - January 16, 2008 - 19:15

FYI, image support was originally part of taxonomy_context, though with the (long since deprecated) node_image module. IIRC when I stripped this out I considered replacing it with taxonomy_image support, but didn't find a really clean way to do so.

#2

lee20 - January 16, 2008 - 19:19

That is a great idea! I believe there is a pending request for beautifying the display of sub terms. This would be a good time to workout those issues as well.

I have only briefly tinkered with Taxonomy Image and I don't recall what kind of support it had for image sizes. But it would be best to offer a few different options. I was thinking something along the lines of:

Taxonomy Image Integration:
Option: Disabled
Option: Shown on Parent Term and Subterm List
Option: Show on Parent Term Only
Option: Show on Subterms Only

It would also be nice if they could determine the display size, but I am not sure if this is handled by Taxonomy Image or can be handled by another module.

Lastly, it would also be nice if you could set a default image to display if a term doesn't have it's own. This would be handy for icons and such but would be better implemented in Taxonomy Image.

So many possibilities and so little time. I am pretty swamped this week, so if anyone else wants to give this integration a shot, otherwise it may be a week or two before I can make this addition.

And I guess while we are discussing features, does anybody see a need for configuring vocabularies seperately?

#3

mcreature - January 17, 2008 - 20:56

Thank you for the response.
I am very glad to here of your interest in implementing this, I am sure many others could use this functionality as well, there could be lots of uses, for Link categories, product categories, etc

I am not versed enough with Drupal code to do this my self, but I would be willing to beta test where I can.

The taxonomy image module only displays one image size, for all terms, though it allows for recursive image display, for any child terms if needed, and a different image for every term if desired.

I believe the Taxonomy List module has some hooks as well, because the Geobrowser module uses it,
for term nav display, The taxo list module also has display settings, for up to 3 or 4 table rows, which can include the images and term description display. I don't know if table rows could be an option, but it would come in handy as well.

As for configuring vocabularies separately, "you got my vote, it would be ideal to have stand alone display possibilities, for different vocabs. for instance, an admin might want images and description text on one vocab, while only descriptions, on another, or possibly different image and text theming, if thats a possibility.

Thanks again.

#4

Summit - February 5, 2008 - 15:44

Subscribing, greetings, Martijn

#5

DanielTheViking - February 6, 2008 - 11:59

Subscribing.

#6

NancyDru - March 25, 2008 - 19:17
Assigned to:Anonymous» NancyDru
Status:active» needs review

Taxonomy Image support.

AttachmentSize
taxo_context_image.patch 1.04 KB

#7

mcreature - April 14, 2008 - 06:23

Note: The Taxonomy image module has recently been updated by Nancyw and now includes many great new features, including image catch implementation for image resizing and much more.

Patch worked for me, Thank you Nancy

#8

Fayna - June 25, 2008 - 02:36

I had trouble getting this patch to work.

(Stripping trailing CRs from patch.)
patching file taxonomy_context.module
Hunk #1 FAILED at 632.
1 out of 1 hunk FAILED -- saving rejects to file taxonomy_context.module.rej

I was using Taxonomy Context 5.x-2.x-dev and Taxonomy Image 5.x-1.0-beta1.

#9

NancyDru - June 25, 2008 - 03:58

The patch was done against 5.x-1.x-dev. The module maintainer should be able to easily adapt it.

#10

norio - October 18, 2008 - 13:13

Thanks for this patch, Nancy :) Saved me some work.

For those interested, to link to the taxonomy from the image, change line 637...

from:

<?php
    $img
= taxonomy_image_display($term->tid);
?>

to:

<?php
    $img
= l(taxonomy_image_display($term->tid), taxonomy_term_path($term), null, null, null, null, true);
?>

(in Drupal 5. Drupal 6 uses slightly different syntax for the l() function)

#11

Gabriel Radic - December 19, 2008 - 21:40

To patch the 2.0 dev version, add the following code before the `break;` declaration on line 466:

<?php
   
if (module_exists('taxonomy_image')) {
       
$subterm_output .= l(taxonomy_image_display($subterm->tid), taxonomy_term_path($subterm), null, null, null, null, true);
    }
?>

I'm no expert but this seems to do the job.

#12

mroscar - August 17, 2009 - 00:51

well wanted to post my solution which from the patch wrapper free for taxonomy image

function theme_taxonomy_context_term($term) {

  $type = $term->subterm ? 'subterm' : 'term';
  $output = '';
  $output .= "<div class=\"$type-container\">\n";
  $output .= "  <div class=\"$type\">\n";

  if (module_exists('taxonomy_image')) {
  $img = l(taxonomy_image_display($term->tid), taxonomy_term_path($term), null, null, null, null, true);
  $checkimg = taxonomy_image_display($term->tid);
  }
  else {
  $img = null;
  }
  if ($term->subterm) {
  $output .= '<h2 class="title">' . l($term->name, taxonomy_term_path($term)) . "</h2>\n";

  if ($checkimg) {
  $output .= '<div class="taximage_wrapper">' . $img. "</div>\n";
  }

  }
  if ($term->teaser) {
    $output .= '  <div class="teaser">' . $term->teaser . "</div>\n";
  }
  else {
  if ($term->description) {
  if ($checkimg) {
  $output .= '<div class="taximage_wrapper">' . $img. "</div>\n";
  }
  $output .= '<div class="description">' . $term->description . "</div>\n";
  }
  }

  if ($term->links) {
    $output .= '   <div class="links">'. theme('links', $term->links) . "</div>\n";
  }

  $output .= "  </div>\n";
  $output .= "</div>\n";
  return $output;
}

#13

NancyDru - October 2, 2009 - 20:11
Version:HEAD» 6.x-2.x-dev
Status:needs review» fixed

Committed to 6.x-2.x-dev.

#14

System Message - October 16, 2009 - 20:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.