I am using the Content Taxonomy module to associate taxonomy terms with CCK fields for better integration with Views to sort etc.
I have products that are associated with a manufacturer and a product line and in my views theming, I would like to pull this data out so that I can display the manufacturer name and product line name in the view. To take this further, I am sorting the the products by product line in the view and I want to separate these groups of products on the screen as follows:
Manufacturer
Product Line X
Product 1 | Product 2 | Product 3
Product Line Y
Product 1 | Product 2
When I do a print_r on my node object, the CCK fields associated with Content Taxonomy looks like the following:
[field_mfg] => Array
(
[0] => Array
(
[18] => stdClass Object
(
[tid] => 18
[vid] => 2
[name] => Yon-Ka for Men
[description] =>
[weight] => 0
)
)
)
[field_product_line] => Array
(
[0] => Array
(
[86] => stdClass Object
(
[tid] => 86
[vid] => 3
[name] => Purify
[description] =>
[weight] => 0
)
)
)
How do I then access the "name" fields of each of these so that I can print them on the screen? Other CCK fields look something like the following:
[field_image_cache] => Array
(
[0] => Array
(
[fid] => 181
[title] => Barber-Shave.jpg
[alt] => Barber-Shave.jpg
[nid] => 101
[filename] => Barber-Shave.jpg
[filepath] => files/Barber-Shave.jpg
[filemime] => image/jpeg
[filesize] => 8941
)
)
With the above, I can simply use $node->field_ingredients[0]['filepath']; for insance to get the file path of an image but the taxonomy related fields look different and I don't get how to access them. They have an array within an array with the array key being the term id of the taxonomy term.
Thanks in advance for any help.