Share » Forums » Developer » How do I work with images from an...

How do I work with images from an extension?

How do I work with images from an extension?

Tuesday 27 June 2006 4:24:03 am - 2 replies

Author Message

Ɓukasz Serwatka

Tuesday 27 June 2006 6:01:52 am

Hei,

You can do like:

include_once( 'kernel/classes/ezcontentobjecttreenode.php' );
 
// {def $node=fetch( 'content', 'node', hash( 'node_id', 82 ) )}
$node =& eZContentObjectTreeNode::fetch( 82 );
 
// {$node.object.data_map}
$object =& $node->object();
$dataMap =& $object->dataMap();
 
// {$node.object.data_map.image.content[original].full_path}
$image =& $dataMap['image']->content();
$aliasList =& $image->aliasList();
$fullPath = $aliasList['original']['full_path'];

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Daniel Staver

Tuesday 27 June 2006 8:07:49 am

Thanks! I'll try that. Will I notice any efficiency gains from doing it with this code instead? My first impressions is that it goes through exactly the same steps as what I do in my template...

Any ideas why my template is so slow in the first place? I'm just listing a bunch of pre-generated thumbnails. It should be possible to do something like that almost instantly.

Daniel Staver
http://daniel.staver.no

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu