Views provides a taxonomy field that lists all related taxonomy terms for a node as one field. This is pretty handy. I wanted to do the same with taxonomy image, though.

This patch provides a new field in the Taxonomy group that will list all attached taxonomy images. If a term does not have an attached image, it simply won't be listed, so you can be sure of an images-only output.

I made this patch mainly by copying and hacking a mixture of the existing views files for Taxonomy Image and the relevant files in Views for Taxonomy. One bonus of this is that it has support for filtering results by vocabulary.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nobody1225’s picture

good

Heilong’s picture

I tried to apply it, but I got this error when configuring the view "Error: handler for term_image > tid_list doesn't exist!".
I patched the file successfully I guess I need to do something for the handler file.

Richard Blackborder’s picture

Unzip the file views_handler_field_taxonomy_image_list.zip into your taxonomy_image module directory. I think that's what is missing.

Heilong’s picture

Good, it's working now

libeco’s picture

I can partly confirm that this works. I will post another issue though which is not related to this one. For some reason every taxonomy image and views combination results in a textual link instead of an image, while on the node display the image is displayed.

So I can confirm that this patch works for one term per vocabulary.

Thanks!

colin_young’s picture

Partially working for me. Images show up in Safari but not Flock (Firefox). Weird. Continuing to investigate.

Update: this is what the links look like in FF

<a href="/category/features/bathrooms"/>

and in Safari:

<a href="/category/features/bathrooms"><img src="http://tgcore/sites/default/files/imagecache/Icon/category_pictures/mapsymb_20.png" alt="Bathrooms" title="Bathrooms" width="24" height="24" /></a>

I can't think of any reason why the output would be different in FF vs. Safari.

Richard Blackborder’s picture

The only reason I know for Drupal stuff to appear different in different browsers is that you are logged in (possibly as superuser?) in one and not in the other. This causes one browser to fetch from the cache and the other to render new.

colin_young’s picture

That was it. I had to grant "access taxonomy images" to anonymous to see the images.

That doesn't seem right to me however. I would think the default should be to show images by default. Also, "view" would be more consistent with other modules than "access". "Access" implies some sort of edit ability.

Other than that, the patch seems to work as advertised (applied against 6.x-1.6).

Richard Blackborder’s picture

Thanks.

(The permission in question is part of the module itself, and is not created by this patch.)

colin_young’s picture

Yeah, I knew the permission was from the module. I probably should create a new issue for that. I was on the train and about to lose internet service, so I was in a bit of a hurry when I posted :).

Richard Blackborder’s picture

Status: Needs review » Reviewed & tested by the community

I'm using this patch in production and now 2 people have said it worked for them, so I'm going to set this status in hope of it getting included in the module itself.

Golem07’s picture

I just wanted to thank you for this patch which made Taxanomy Image+views usable for me!
This really ought to make it's way into the next release.

BWPanda’s picture

Version: 6.x-1.6 » 6.x-1.x-dev

It'd be great to get this committed...

emilyf’s picture

@likeless this is awesome. thank you.

psychoman’s picture

thank you very much!

weblance’s picture

I have done the patch and uploaded the zip to the tax image directory. I am not able to see any option for ALL IMAGES in the field select.

Richard Blackborder’s picture

Jeff, the patch certainly works, so maybe you just need to reapply it and clear your Drupal cache. If that doesn't fix it, let me know which version of the module you are patching. The patch is 6 months old now so it may not agree with 6.x-1.x-dev, I don't know.

BWPanda’s picture

Status: Reviewed & tested by the community » Needs work

One small problem (feel free to change this back to RTBC if you don't think it's a commit blocker):

'Taxonomy: Term image' provides a key/value (term_image_tid) in Views' $record object so you can see the TID of the image.
'Taxonomy: All term images' doesn't provide this. Ideally, this'd be something like: term_image_tids = array(8, 14, 15, 27, 45); made available to Views' $record object.

Are you able to edit the patch to add in this functionality?

Richard Blackborder’s picture

Status: Needs work » Reviewed & tested by the community

I did a search through all the files in the module for "term_image_tid" and did not find that string anywhere. Can you point me to where this is being done?

If term_image_tid is being created automatically, then it may require some special technique int he handler to do the same with this field, which is a more complex composite field.

I've changed the status back because I think it is clear the patch is functional and popular as it is and I think it would be a good commit. But if I figure this out, I will certainly create an updated version.

supersteph’s picture

subscribe

BWPanda’s picture

Regarding my above request, I posted about this in the Views issue queue: #735604: Output views_handler_field_prerender_list in $result

BWPanda’s picture

Here's Likeless' patch, but rolled into one file and created against the latest dev version.
The only change I made was to the help text for the new field (a copy/paste error had it saying the same thing as the 'Taxonomy: All terms' field...)

Ready to commit I think.

Golem07’s picture

Well, a feature request but I think it fits in here a lot better:

The single missing feature now would be to display all taxonomy images and all taxonomy terms next to each other at once (e.g. for a list of country with their flags or a list of football clubs with their banners etc.)

You can do this right now with the standard Taxonomy features... but just for a single term.

Would it be very complicated to alter/enhance this patch in such a way?

pebosi’s picture

Just searching for this functionality for a new project. #22's patch is working for me.

i think it could be committed.

regards

intyms’s picture

here is another issues #471530: Displaying all terms' images in a view
There is also a patch which, i think, gives us the same functionality.
Can anybody review both patches and tell us which of them is better for commitment?

prince.pangaea’s picture

FileSize
331.62 KB

i tried likeless' patches and it triplicates the rows
i have two terms in a vocab selected from among 4 and when it displays in the view there are three rows for the same node with the two pictures beside it

intyms’s picture

to #26 prince.pangaea

can you try also the patch from this issue? #471530: Displaying all terms' images in a view
I uploaded also the whole module, see my message no. #21 in that issue.

added later:
i tried to do the same thing as you and the patch from that issue worked well for me.

prince.pangaea’s picture

still not working
i have patched with these before
and have tried both the patch at the top of #471530 http://drupal.org/node/471530 and http://drupal.org/node/471530#comment-3037228 (#21)
what next...

intyms’s picture

FileSize
19.63 KB

@#28 prince.pangaea

if you use http://drupal.org/node/471530#comment-3037228 you have to choose a new field for your views.
See attached file. Also be sure to configure the field settings and views filters.

prince.pangaea’s picture

sorry for bugging but this is an export of my view (attached)
drupal 6.12 (i know its outdated)
Taxonomy Image 6.x-1.x-dev (2010-May-03)
Views 6.x-2.5

intyms’s picture

//30

I am sorry i am unable to find the error.
Can you try to achieve the same result using the latest releases?

ShutterFreak’s picture

This is precisely the functionality I was expecting from the taxonomy image module.

Any chance of it being released soon?

dca123’s picture

Category: feature » support

Using #22 I get the message "Error: handler for term_image > tid_list doesn't exist"

Any help on this?

eugen80’s picture

#22 worked well!

thanks!

bisonte_biscottato’s picture

#22 works.

For #33, make a new "All term image" field.

XiaN Vizjereij’s picture

#22 Works fine. Thank you very much.

shopdogg’s picture

sub

SweeneyTodd’s picture

subscribing

carvalhar’s picture

hi i tried to apply the patch of comment #22, it seens to be applied well, i don't ave any error, but i do not have a new field to choose all taxinomy term images...

what should be worng?

*edit* I had to clean cache...then the update worked.

AntiNSA’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Isnt this a duplicate of this : http://drupal.org/node/471530

Whats the difference?

AntiNSA’s picture

Status: Closed (duplicate) » Active

didnt mean to close, only mark as duplicate.

ekes’s picture

Category: support » feature
Status: Active » Reviewed & tested by the community

I'd leave this one open, and possibly change the other as a dupe. The patch here:-
* works and doesn't suffer the settings bug in the other issue
* is written so it extends the existing all terms from views
* works with views 3

AntiNSA’s picture

Can anyone tell me if this is working on latest dev? I was using the other version, but I cant show two fields of all images. I would like to try this, but am unsure if it works against latest dev.....

newnewuser’s picture

Hi all,
I am new to drupal. My hosting doesn't allow me to patch. Can anyone suggest how can I get the patch to enable All Term Image to work? Really appreciate if anyone can help!!

JThan’s picture

Patch in #22 works with latest dev Version from project page. Thanks everyone.

AntiNSA’s picture

Can anyone fix this to work with latest dev version?

pebosi’s picture

FileSize
5.32 KB

Rebuild #22's patch for latest dev release.

nehajyoti’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)

6.x version is outdated. Hence closing the issue!