Hello all,

i'm trying to get my term image data (filepath essentially) into the node object i get from a view with row style set to node.
basically, my view is called with services view.get to connect to a flash application.

i get all the raw node object but can't see my term image to show anywhere.

What i would like to get is my term image data in the taxonomy object as it appears below :

 [taxonomy] => Array
                (
                    [18] => stdClass Object
                        (
                            [tid] => 18
                            [vid] => 3
                            [name] => term name
                            [description] => term description
                            [weight] => 0
                            [language] => 
                            [trid] => 0
                            [term_image_path]=>myimagefilepath              <= is it possible ?

                        )
)

Any idea how ?

Thx a lot !

Comments

alexislm’s picture

Answering myself with a very ugly core module hack ...

maybe it could help sbdy with same problem.
If someone could come with a cleaner approach it would be just wonderful !

//taxonomy.module line 629

function taxonomy_node_get_terms($node, $key = 'tid') {
  static $terms;

  if (!isset($terms[$node->vid][$key])) {
    $result = db_query(db_rewrite_sql('SELECT t.* FROM {term_node} r INNER JOIN {term_data} t ON r.tid = t.tid INNER JOIN {vocabulary} v ON t.vid = v.vid WHERE r.vid = %d ORDER BY v.weight, t.weight, t.name', 't', 'tid'), $node->vid);
    $terms[$node->vid][$key] = array();
    while ($term = db_fetch_object($result)) {
      $term->image_path=taxonomy_image_get_term($term->tid)->path;
      $terms[$node->vid][$key][$term->$key] = $term;
    }
  }
  return $terms[$node->vid][$key];
}