function scald_example_content_type_scald_fetch in Scald: Media Management made easy 6
Implements hook_scald_fetch.
File
- scald_example_content_type/
scald_example_content_type.module, line 100 - Contains an example implementation of a node type that will be used to provide atoms to Scald. For this example sake, we(ll be providing Image atoms based on pictures attached to this node.
Code
function scald_example_content_type_scald_fetch(&$atom) {
$node = node_load($atom->base_id);
if (is_array($node->files) && count($node->files)) {
$file = reset($node->files);
}
$atom->base_entity = $node;
$atom->file_source = $atom->thumbnail_source = $file->filepath;
}