1

I can't find a way how to get an atom reference's values (image path etc.) into my theme template. When printing the node array I do get the SID for the referenced image, but I just don't know how to load the actual details.

Or is it possible by simply using node_load or entity_load or the like? Any pointers gladly appreciated.

1 Answer 1

1

Found the answer to my question one of scald's issue pages – and it's not really complicated. Either it's just not well documented, or I just didn't see it:

This gets the SID from the node's array:

$img = $vars['node']->field_teaser_image['und'][0]['sid'];

And this fetches the atom reference's object:

$atom = scald_atom_load($img);

This is how I then load the title of the atom reference image inside template.php:

$vars['img_title'] = $atom->title;

And the actual filename is inside another object base_entity:

$vars['img_filename'] = $atom->base_entity->filename;

Hope this may help somebody some day.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.