Category Images

zakmck - May 18, 2006 - 08:58

Hi all,
sorry for possible dupes, I cannot find some note about the following issue.

Is there a module to manage images that are associated to categories? I would like a drupal installation that behaves like PHPNuke, where contents belongs to a category (would be more than one in Drupal), and each category has an associated image. Furthermore, each content would be shown with the image of the associated category on the right (would need to choose a main category in Drupal or alike).

Has anyone developed something like that?

Thanks in advance.

Cheers.

Taxonomy image

4d - May 19, 2006 - 02:07

Here is the one.

http://drupal.org/node/8121

Thanks a lot. Although it is

zakmck - May 19, 2006 - 23:26

Thanks a lot. Although it is unuseable for me. I poorly know the themes and alike and I don't know where to put the hands and have the image used. I hope for future developements.

Category Module

lizabeth - June 15, 2006 - 15:11

Has anyone had success in changing the Taxonomy Image module to work with the Category Module? This is the final piece I'm looking for with my current project.

I haven't tried it yet, but

venkat-rk - June 15, 2006 - 15:57

I haven't tried it yet, but the taxonomy wrapper modules let you use just about any taxonomy based module, so there is just a chance taxonomy_image might work with category also.

Don't think it works

thewebtailor - August 23, 2006 - 11:16

I have tried it - although the taxonomy wrapper is supposed to enable backwards compatibility so that you can use other taxonomy modules with the category module, I have not been able to get taxonomy_image to work - the admin >> category page doesn't have any kind of options for adding images to categories. Anyone got any ideas?

Got it working :-)

chrislynch - September 21, 2006 - 16:46

Worked for me using the latest version (cvs, from the module's own page), but you have to create your own menu link to ?q=admin/taxonomy/image. For some reason, the one defined in the _menu hook didn't appear even after I refreshed my menu.

Onec you've got the link though, you can upload images and call the taxonomy_image_display() function, just pass it in the nid of the category node.

Thanks chris, just what I

Jeff Burnz - September 30, 2006 - 11:29

Thanks chris, any chance you could explain this a little further, I'm not sure how to impliment this.

When using Categories Module, create your own link

AdAstra - December 5, 2006 - 01:46

Because I am also using the Categories module (not the Taxonomy module), I created a menu that links to the page where I can associate taxonomy terms with images:

administer > menus > click on add item

Fill in the required fields:
Title: tax_img_assoc
Path: admin/taxonomy/image

From the Parent drop-down, chose where you want this new menu to appear. I placed it under administer. Click the Submit button.

Et voila!

Note: this works because I have Clean URLs enabled. When I tried using ?q=admin/taxonomy/image as the Path, the '?' and '=' symbols got converted to '%' and I got an Error 404...

-------------------------------------------------
AdAstra.ca - Optimze the Web. Optimze the World.

Summary Guide to taxonomy_image

AdAstra - December 5, 2006 - 09:12

Taxonomy Image is a great little module, so I wanted to make it work without altering/hacking the taxonomy_image.module (as best practice and for smoother upgrades). I’ve read every single post/comment from a search for “taxonomy_image.” Here’s a Summary Guide to setting up taxonomy_image.

Step 1.
Set the File System path: administer > settings > click on File system settings, then type files under File System path

Step 2.
Download the latest taxonomy_image module. Unzip it, then upload the files into your site folder: module/taxonomy_image/

Step 3.
Enable the module: administer > modules > check the box next to taxonomy_image in the status column. Make sure the taxonomy module is also enabled.

Step 4.
Enable permissions: administer > access control > check all 3 boxes under taxonomy_image module in the authenticated users column so that administrators can configure taxonomy_image settings. Check access taxonomy images in the anonymous users column so that users can see taxonomy images.

Step 5.
Configure the taxonomy_image module: administer > settings > taxonomy_image
If you're using taxonomy hierarchies, and you wish to assign one image to an entire tree of terms, enable 'recursive image display'. If you're not sure what this means, leave this option disabled.

Step 6.
Associate taxonomy terms with images: administer > categories > images > click upload image to make the association
(If you’re using the Category module (instead of the core Taxonomy module), see Dec. 4 comment below.)

Step 7.
Add the following code into your template.php and upload it (eg. to mysite.com/themes/mytheme/). This overrides the taxonomy_image.module, without hacking/changing it. If you don’t have a template.php file, create one and make sure it has .php extension.

<?php
function _phptemplate_variables($hook, $vars) {
  if (
$hook == 'node') {
    if (
module_exist("taxonomy_image")) {
       foreach (
taxonomy_node_get_terms($vars['node']->nid) as $term) {
       
$vars['taxonomy_images'][] = taxonomy_image_display($term->tid, "alt='$term->name'");
       }
    }
  }
return
$vars;
}
?>

!!! In template.php, make sure there are no white spaces after the last ‘?>’

Step 8.
Add the following code into your node.tpl.php, at the place where you want the taxonomy image to appear, and upload it (eg. to mysite.com/themes/mytheme/). Note: If you place this code in page.tpl.php, the image does not appear. I read that it’s because some variable or other is not passed.

<div class="taxonomy_image">
  <?php print $taxonomy_images[0] ?>
</div>

Step 9.
Customize your CSS to suit your needs. The code below will align the image to the right, and push everything else to its left.

.taxonomy_image{
   float: right;
}

P.S. If you use xtemplate, these posts might help: http://drupal.org/node/23439 #9.

The grand finale: I got it working… partially.

The taxonomy image only appears on pages that have no children.
www.adastra.ca/zen/book_of_smiles

Any category that has child nodes will not display the image... If you click around on the above site, parents don't display taxonomy image. Only last child does. Any ideas? Is it because I’m using the Category module (and not the core Taxonomy module)? Would very much appreciate user experience and/or feedback.

-------------------------------------------------
AdAstra.ca - Optimze the Web. Optimze the World.

Any category that has child

venkat-rk - December 6, 2006 - 12:48

Any category that has child nodes will not display the image... If you click around on the above site, parents don't display taxonomy image. Only last child does. Any ideas? Is it because I’m using the Category module (and not the core Taxonomy module)?

By child nodes, do you mean child categories or nodes tagged with a category? Your problems sound like the taxonomy wrapper is not doing too good a job of syncing with the taxo_image module.

----
Previously user Ramdak. Feeling comfortable enough to use my real name after two years with drupal;-)

After new install, taxo_image on certain nodes

AdAstra - December 10, 2006 - 10:10

Interesting observation. "Child nodes" refers to nodes tagged with a category. Taxo_img does not appear on any categories (whether parent or child).

After a fresh install, with all necessary modules in place, I used this structure:
category1
--subcategory1
----nodeA
----nodeB
--nodeC
--nodeD

Taxo_img does not appear on category1, subcategory1, nodeA, and nodeB. But it does appear on nodeC and nodeD.

If I move nodeA to be a direct child of category1, like this:
category1
--subcategory1
----nodeB
--nodeA
--nodeC
--nodeD
Then taxo_img appears on nodeA.

I'll just work around it, I like Jaza's category module too much to give it up.

-------------------------------------------------
AdAstra.ca - Optimze the Web. Optimze the World.

AdAstra did you see my post below

newdru - December 10, 2006 - 10:35

about flash on your site?

doesn't work for me

doudou - February 4, 2007 - 03:27

I am a beginner at this, so maybe I am doing something wrong. But after pasting the codes you mentioned, I get lots of error and such. I am sure I got the correct files but is there a specific placement of these codes?

Got this to work

Titus98usn - February 17, 2007 - 18:59

I'm using the taxonomy_image-5.x-.10-beta1 module with Drupal 5.1

I followed the above with these changes

1) I manually added the category_pictures folder to my files directory
2) I made sure that both this and the parent folder had 777 permissions
3) I changed this line above- if (module_exist("taxonomy_image")) {
to this - if (module_exists("taxonomy_image")) {

Taxonomy image on page.tpl

Raele - March 12, 2007 - 22:56

Hi guys,

I don't know if this place is right for my questions, and I'm sorry if is not. (this is my first post here)

I using drupal since 4.2 for various project and I always resolve my little problem by using this forum and your help, but now I've a little problem that i can't solve and cannot find here.

My answer is about taxonomy image: i'm using drupal 4.7.6, i've installed taxonomy_image module, i've read instructions for install and all going right.

My problem is that i need to visualize the image associate with taxonomy term not in node.tpl but in a div that I've create in page.tpl, like an header that change the image in respect to taxonomy vocabulary and term.

I understand that i've to write php code for this, because, ever if I understand, when page.tpl is compiled there's no tid to pass like in node.tpl.

I hope that I've right explained my intentions: someone can help me?

Taxonomy_image in page.tpl.php

J. Cohen - March 28, 2007 - 17:55

I'm also looking for the answer to this. My taxonomy images have to go in the page.tpl.php template.

Drupal 5.1

Nigeria - September 12, 2007 - 09:22

Step 7 causes Drupal 5.1 to break!

Ade Atobatele

A Little Off Topic

newdru - December 7, 2006 - 06:22

AdAstra...

How did you create the interactive flash world map at

http://www.adastra.ca/travel

did you do that yourself or just download that from somewhere??

thanks

Interactive world map

AdAstra - December 10, 2006 - 11:35

I customized it, but got the flash file from DIY Map. I've added a link to DIY Map below my map on www.adastra.ca/travel.

-------------------------------------------------
AdAstra.ca - Optimze the Web. Optimze the World.

thanks

newdru - December 10, 2006 - 20:58

for posting the info

two images per category

capono - May 7, 2007 - 08:50

I like to have 2 (ore more) images per category. Is that possible, can you give me a hint? Or is there another modules/snippet that does the trick?

Multiple Category Images please

simonsparks - August 30, 2007 - 16:39

I also need to have more than one image per category.
I am using ubercart where each category represents a particular group of products.

When the user navigates to a category, the products in the category are listed on that page along with the category's description and one image (using taxonomy_image).
However, I would like several images to be available for that category page.

Is there any way to do this?

Multiple Categories...

dmetzcher - October 9, 2007 - 17:31

I have multiple taxonomies chosen for a few nodes. Can I display the images for all the taxonomies chosen? Right now, it seems to pick one and display it.

 
 

Drupal is a registered trademark of Dries Buytaert.