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.
Comment | File | Size | Author |
---|---|---|---|
#47 | 493150-image-list.patch | 5.32 KB | pebosi |
#30 | views_taximage_export_problem.txt | 11.33 KB | prince.pangaea |
#29 | tax_image_all.jpg | 19.63 KB | intyms |
#26 | wwscreenti.jpg | 331.62 KB | prince.pangaea |
#22 | taxonomy_image-all_term_images.patch | 5.76 KB | BWPanda |
Comments
Comment #1
nobody1225 CreditAttribution: nobody1225 commentedgood
Comment #2
Heilong CreditAttribution: Heilong commentedI 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.
Comment #3
Richard Blackborder CreditAttribution: Richard Blackborder commentedUnzip the file views_handler_field_taxonomy_image_list.zip into your taxonomy_image module directory. I think that's what is missing.
Comment #4
Heilong CreditAttribution: Heilong commentedGood, it's working now
Comment #5
libeco CreditAttribution: libeco commentedI 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!
Comment #6
colin_young CreditAttribution: colin_young commentedPartially 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.
Comment #7
Richard Blackborder CreditAttribution: Richard Blackborder commentedThe 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.
Comment #8
colin_young CreditAttribution: colin_young commentedThat 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).
Comment #9
Richard Blackborder CreditAttribution: Richard Blackborder commentedThanks.
(The permission in question is part of the module itself, and is not created by this patch.)
Comment #10
colin_young CreditAttribution: colin_young commentedYeah, 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 :).
Comment #11
Richard Blackborder CreditAttribution: Richard Blackborder commentedI'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.
Comment #12
Golem07 CreditAttribution: Golem07 commentedI 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.
Comment #13
BWPanda CreditAttribution: BWPanda commentedIt'd be great to get this committed...
Comment #14
emilyf CreditAttribution: emilyf commented@likeless this is awesome. thank you.
Comment #15
psychoman CreditAttribution: psychoman commentedthank you very much!
Comment #16
weblance CreditAttribution: weblance commentedI 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.
Comment #17
Richard Blackborder CreditAttribution: Richard Blackborder commentedJeff, 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.
Comment #18
BWPanda CreditAttribution: BWPanda commentedOne 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?
Comment #19
Richard Blackborder CreditAttribution: Richard Blackborder commentedI 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.
Comment #20
supersteph CreditAttribution: supersteph commentedsubscribe
Comment #21
BWPanda CreditAttribution: BWPanda commentedRegarding my above request, I posted about this in the Views issue queue: #735604: Output views_handler_field_prerender_list in $result
Comment #22
BWPanda CreditAttribution: BWPanda commentedHere'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.
Comment #23
Golem07 CreditAttribution: Golem07 commentedWell, 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?
Comment #24
pebosi CreditAttribution: pebosi commentedJust searching for this functionality for a new project. #22's patch is working for me.
i think it could be committed.
regards
Comment #25
intyms CreditAttribution: intyms commentedhere 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?
Comment #26
prince.pangaea CreditAttribution: prince.pangaea commentedi 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
Comment #27
intyms CreditAttribution: intyms commentedto #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.
Comment #28
prince.pangaea CreditAttribution: prince.pangaea commentedstill 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...
Comment #29
intyms CreditAttribution: intyms commented@#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.
Comment #30
prince.pangaea CreditAttribution: prince.pangaea commentedsorry 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
Comment #31
intyms CreditAttribution: intyms commented//30
I am sorry i am unable to find the error.
Can you try to achieve the same result using the latest releases?
Comment #32
ShutterFreak CreditAttribution: ShutterFreak commentedThis is precisely the functionality I was expecting from the taxonomy image module.
Any chance of it being released soon?
Comment #33
dca123 CreditAttribution: dca123 commentedUsing #22 I get the message "Error: handler for term_image > tid_list doesn't exist"
Any help on this?
Comment #34
eugen80 CreditAttribution: eugen80 commented#22 worked well!
thanks!
Comment #35
bisonte_biscottato CreditAttribution: bisonte_biscottato commented#22 works.
For #33, make a new "All term image" field.
Comment #36
XiaN Vizjereij CreditAttribution: XiaN Vizjereij commented#22 Works fine. Thank you very much.
Comment #37
shopdogg CreditAttribution: shopdogg commentedsub
Comment #38
SweeneyTodd CreditAttribution: SweeneyTodd commentedsubscribing
Comment #39
carvalhar CreditAttribution: carvalhar commentedhi 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.
Comment #40
AntiNSA CreditAttribution: AntiNSA commentedIsnt this a duplicate of this : http://drupal.org/node/471530
Whats the difference?
Comment #41
AntiNSA CreditAttribution: AntiNSA commenteddidnt mean to close, only mark as duplicate.
Comment #42
ekes CreditAttribution: ekes commentedI'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
Comment #43
AntiNSA CreditAttribution: AntiNSA commentedCan 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.....
Comment #44
newnewuser CreditAttribution: newnewuser commentedHi 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!!
Comment #45
JThan CreditAttribution: JThan commentedPatch in #22 works with latest dev Version from project page. Thanks everyone.
Comment #46
AntiNSA CreditAttribution: AntiNSA commentedCan anyone fix this to work with latest dev version?
Comment #47
pebosi CreditAttribution: pebosi commentedRebuild #22's patch for latest dev release.
Comment #48
nehajyoti CreditAttribution: nehajyoti as a volunteer and at QED42 commented6.x version is outdated. Hence closing the issue!