Help with taxonomy and image paths

N.Simpson - December 3, 2008 - 23:57

This may indeed be an incredibly basic and somewhat stupid question but I have the following problem.

I have product nodes using a beta version of ubercart, each of these products has a main product shot and a gallery of thumbnails. In order to maintain a sensible structure the product images are uploaded using FTP to the images folder and have a sub-directory structure of /x/y/z/product.jpg or /x/y/z/gallery/*jpg where x, y, and z are the hierarchical taxonomy terms used to categorise the node. What is the best way of getting Drupal to display these images on the product pages? I'm a fairly compentent PHP programmer but have very little experience with the drupal framework so I'm more than happy to get my hands dirty with code but equally happy to use any existing modules should that be the most sensible (maintainable and security updated by someone else) way.

Thanks for any help you can provide.

-Neil

Update

N.Simpson - December 4, 2008 - 00:26

Ok, a little more digging and I managed to create a node-product.tpl.php which contains most of the information that I require. This final piece of the puzzle is extracting the taxonomy hierarchy, any hints on how to do this?

Solution

N.Simpson - December 4, 2008 - 00:57

Seems simple if you can find the function.
Looks like a quick call of:taxonomy_get_parents_all($node->taxonomy->tid); is all that's required. I can use the name fields on the array of hashes that is returned to construct the URLs and voila, easy image management.

 
 

Drupal is a registered trademark of Dries Buytaert.