Theming views to use imagecache
Agaric needs to make a view, such as a preview of an image gallery for the front page of a site, use imagecache to generate cropped and resized thumbnails.
Resolution
<?php
print_r($node);
?>
stdClass Object
(
[nid] => 6
[files_filepath] => sites/anjaliforberpratt.com/files/images/137901886019f.jpg
)
So it's saying, I am an object, I am called node, this is what I am made up of.
We want it to print our node, the entire node.
So we have to load it:
$agaric_image_node = node_load()
Here we've found the piece we care about:
[images] => Array (
[_original] => sites/anjaliforberpratt.com/files/images/137901886019f.jpg
[preview] => sites/anjaliforberpratt.com/files/images/137901886019f.preview.jpg
[thumbnail] => sites/anjaliforberpratt.com/files/images/137901886019f.thumbnail.jpg
)
This is in a node object, so when we call it it will be in the form $agaric_image_node->images['_original']
.
And this is the most inefficient way to theme an image to use an imagecache preset through views that I can imagine.
If there isn't a view that can output the filepath of the original image, we should make a module that does that.
Comments
Post new comment