views:

37

answers:

1

I created a View that gets the title, body and attached image of some Story nodes. I need to use the Customfield "PHP code" to customize the output but the problem is that it's only giving me the id of the image in an array like this: [image_attach_iids] => Array ( [0] => 66 ). So, I it looks like it's giving me the id but I need the full path of the image also. Is there some function that I need to call to get the path?

thank you

A: 
  1. If you are using fields, you can put the image as a field. Put it at the top of your fields (so you can use replacement patterns).
    Setup:
    exclude from display, select 'path to image' in the Format option, and then use the replacement pattern in your customField PHP

  2. If you aren't using fields, you can build up the path in the node-[contenttype].tpl.php .

  3. Pathauto module: use the function drupal_get_path_alias($path) to get the aliased path to the node. $path = 'node/'.$node_id

Jozzeh