Wednesday, January 8, 2014

Getimage name for media field selector filed Drupal 7

1st got to admin /admin/structure/types/manage/your-content-type/display change the Format of media file selector field to rendered file
Fig 1.0 Fig 1.1 Fig 1.2



and place this code in yout tpl

$node = node_load($row['nid']);  

for($i=0;$i<count($node->your-field-name['und']);$i++) {
   //your file name
    print $node->field_product_images['und'][$i]['filename'];

}

No comments:

Post a Comment