I need to add id tag to an image which is a field of a view
. Currently it seems only possible to add a class name.
<img typeof="foaf:Image" ...
must become => <img id="xxx" typeof="foaf:Image" ...
Searching for typeof="foaf:image" I found that was set by rdf module preprocess_image, not in views. Therefore I added a preprocess function
function MYTHEME_preprocess_image(&variables){
// compute first MY_UNIQUE_ID
$variables['attributes']['id'] = array('MY_UNIQUE_ID');
}
now it works.
views-view-fields.tpl.php
. Edit that (or the correct one) for your field to add the CSS ID to the html and then use the appropriate preprocess to add the$css_id
var to it.