Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello.
I have a view that outputs a list of nodes and each node may have more than one taxonomy term, even from different vocabularies - how can I output all of these, or select from which vocabulary I want the images to be displayed?
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#22 | tax_image_all2.jpg | 23.69 KB | intyms |
#21 | taxonomy_image.zip | 58.54 KB | intyms |
#17 | taxonomy_image_multiple_images.patch | 7.25 KB | Ghostthinker |
#12 | view error.jpg | 183.58 KB | weblance |
#10 | views_all_terms_image.tar_.gz | 7.71 KB | manumilou |
Comments
Comment #1
ErwanF CreditAttribution: ErwanF commentedHello,
Same need here (with the same version, 6x-1.6). I'd like to use Taxonomy image as a way to display various little black and white logos (a taxonomy image previously associated to a term) near a photo and some text in a view. But I can only display one logo or twice the same one (please see screenshot) while adding another "Taxonomy: Term Image" field. The tid seems to call always the same term, but obviously, I would like to show different thumbnails (from different vocabularies or from a single "thumbnails" vocabulary if the former is impossible) in a single "teaser".
This may comes from the Views module above all, but we were asked to ask you first, so...
Comment #2
ErwanF CreditAttribution: ErwanF commentedAnyone?
Comment #3
borfast CreditAttribution: borfast commentedErwanF, I ended up adding a function to template.php to (sort of) achieve what I wanted.
The function takes the output of the "Taxonomy: all terms" views field, which is basically an HTML list of links to each taxonomy term. I break them apart and replace the linked text with the desired image.
Far from perfect, since this should belong in the module itself, but at least it works.
Note: "Tamarind" is the name of the theme I'm working with.
Comment #4
ErwanF CreditAttribution: ErwanF commentedThanks a lot for the "tip", borfast, I'll try that.
Comment #5
ErwanF CreditAttribution: ErwanF commentedPlease could you explain? How do replace the term name by its image? At the time of writing, I can only display the terme name...
Comment #6
ErwanF CreditAttribution: ErwanF commentedI didn't manage to make this working. So sad...
Comment #7
borfast CreditAttribution: borfast commentedErwanF, sorry, I had not yet seen your request for an explanation.
When I say
I mean that I have a "All terms" field, which prints something like
<a href="taxonomy/term/5">Books</a>, <a href="taxonomy/term/6">Cars<a>, <a href="taxonomy/term/7">Houses</a>
and I break it apart on the commas, which yields an array of individual links, which I then treat as necessary.The commas are separating the links because that's how I configured the field.
Comment #8
iandreev CreditAttribution: iandreev commentedI developed a patch for this module, which is atached to this comment. It allows to display all term images for a given node as a single view field without generating duplicate rows. They are especially frustrating if you use multi-choice vocabularies to tag articles on your site, like me. Tested with drupal-6.14 and taxonomy_image-6.x-1.6.
After applying the patch flush caches so that views will use new field definitions and restart Apache to purge PHP optimizer caches.
Edit your view and add a new field. Choose "Taxonomy: All term images" as a field type. Here you have an option to limit search for images in a given set of vocabularies, similar to the "Taxonomy: All terms" field, and additionally you can choose to display only one image, if more than one are available.
Internally, this field creates two fictious query fields, "all_tid" and "all_tid_all_tids". The latter is an array of image ids and is used internally to render multiple images. The former is the master field and it contains only a single term id for an image. I needed it for compatibility with the "timeline" module, which cannot work with multiple images.
All the best.
Comment #9
manumilou CreditAttribution: manumilou commentedSubscribing
Comment #10
manumilou CreditAttribution: manumilou commentedThank you vidkinet for your patch, it is working well. I built it as a module that adds a field All terms image in the views field.
Enjoy
Manu
Comment #11
weblance CreditAttribution: weblance commentedYou sir are brilliant! Saved me on this one!
By the way, something with tar that isn't right. I had to open and manually upload each file. Does not extract properly.
Comment #12
weblance CreditAttribution: weblance commentedI have had a strange bug. The module works great but it seems there might be a little glitch. In a grid view, the first item does not show any images. Attached is the error. The images are the hotel amenities icons below the hotel pic. As you can see the first hotel in the grid is not showing any amenities icons.
Comment #13
greta_drupal CreditAttribution: greta_drupal commentedThe Taxonomy Image module was a great find (actually a referral from a post for solution); thanks NancyDru. After spending about 6 hours to upload a flag icon for some 300 countries, I was sweating when my views came up flagless; and wondering how to specify which tax term image to display.
So, major thanks to vitkinet and manumilou for whipping up this patch and module! It will be a great addition to the new version of the mod.
Greta
Comment #14
Pls CreditAttribution: Pls commentedI can confirm that this bug with first image is happening, but it seems that it happens in every view style (grid, html list, unformatted). Possible sql bug. Im not a real programmer so cant help here. Hope that this bugfix will not be forgotten. Cheers!
Comment #15
MBroberg CreditAttribution: MBroberg commentedIs this supposed to be working with relationships?
I have it working when the terms are attached to the primary nodes called for a view, but not in relationships where the terms are attached to a different node and referenced via a node reference CCK field.
The All Terms field works that way, but not the All Terms images.
Great and critical addition to the TI module by the way!
Comment #16
supersteph CreditAttribution: supersteph commentedI'm trying to make a views2 slideshow of taxonomy images from a certain vocab. It works fine displaying the terms, but when i try to display the images, i get nothing. any ideas?
i've been searching everywhere and can't find a solution. hope this is an ok thread for this issue!
Comment #17
Ghostthinker CreditAttribution: Ghostthinker commentedHi, I made a patch (against 1.6) to make this work without a seperate module. If anyone is interessted. Haven't tried it with gridview.
Comment #18
Poieo CreditAttribution: Poieo commented+1 to see this included in the module. Very helpful.
Comment #19
intyms CreditAttribution: intyms commented+1 to see it (patch from #17) included in the module.
The new views field "Taxonomy All Terms Images" is very useful.
Thanks a lot for all contributors.
Comment #20
intyms CreditAttribution: intyms commentedhere is another issues #493150: New Views Field: All Associated Taxonomy Images.
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 #21
intyms CreditAttribution: intyms commentedi attache the patched module (i patched manually the dev version from 2010-May-03).
Comment #22
intyms CreditAttribution: intyms commentedThe patch from #17 works fine if we use only one "Taxonomy All terms Images" field inside of our views.
But if we add 2 "Taxonomy All terms images" fields then the settings from the second field will override the settings of the first field.
See attached file.
Comment #23
awakenedvoice CreditAttribution: awakenedvoice commentedSubscribing
Comment #24
AntiNSA CreditAttribution: AntiNSA commentedsubscribe
Comment #25
lucascaro CreditAttribution: lucascaro commentedJust tried patch #17 and wanted to say thank you! it seems to work perfectly with 6.x-1.6
Comment #26
bisonte_biscottato CreditAttribution: bisonte_biscottato commentedsame error of #22. Impossible to show two or more All terms image field.
Comment #27
OFF CreditAttribution: OFF commented#21 Module works perfect!
Comment #28
gaintsev CreditAttribution: gaintsev commentedMany thanks to all!
Comment #29
makt CreditAttribution: makt commentedThank you #21! Makes life so much easier when things work perfectly!
Comment #30
mplewis CreditAttribution: mplewis commentedI installed the patch from #21, but when I try to add a "Taxonomy: All Terms images" field to my View, I get the following error:
Error: handler for term_image > all_tid doesn't exist!
When I hit the cancel button, I end up with:
Broken/missing handler: term_image > all_tid
I'm running Drupal 6.17 with Views 6.x-2.11.
UPDATE: I reverted back to Taxonomy Image 6.x-1.6 and installed the separate module from #10, and everything is working nicely now. Thank you!
Comment #31
jofdesign CreditAttribution: jofdesign commentedThank you it works for me.
I wonder if I could access the value returned by the field from a page.tpl.php or page-taxonomy-term.tpl.php, and exclude the field from the display in the view; so I can display the image out of the embed view.
I tried to use the template_preprocess_views_view_field in my template.php. But I don't know how to get further with this.
Thank you.
Comment #32
baff CreditAttribution: baff commented#10 works for me - thanks
Comment #33
neillodwyer CreditAttribution: neillodwyer commentedThanks to everyone who contributed to this patch. It work a treat. Very helpful indeed.
Comment #34
ekes CreditAttribution: ekes commentedPatch on #493150-22: New Views Field: All Associated Taxonomy Images working, doesn't suffer settings bug above, does seem to re-use more of the views class (and still works as of this moment with views 3).
Comment #35
AntiNSA CreditAttribution: AntiNSA commentedwhen can this be rolled into working dev? this works great for me w/views 3
Comment #36
NancyDruDoes Views 3 even have a full official release yet?
The status here is "needs work" and I'd like to see RTBC.
Comment #37
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 #41
newnewuser CreditAttribution: newnewuser commented#37 You may want to try http://bri-space.com/content/how-patch-drupal-module-windows
I used it for another patch, but due to version incompatibility, it didn't work for me. But it may work for this patch.
Here's another thread of patch for windows... http://drupal.org/node/23844
Comment #42
AntiNSA CreditAttribution: AntiNSA commentedAny way to get this patch on the newest version as there is a securiy update on this module?
Comment #43
apadernoI am closing this support request, since it has been opened for a project version that isn't supported anymore (as Drupal 6.x isn't anymore supported.)
Comment #44
perkotek CreditAttribution: perkotek as a volunteer commentedImpossible to show two or more All terms image field.x ray cihazı