Syntax API for get original url of an image

Syntax API for get original url of an image

Sunday 30 November 2008 6:59:32 am - 3 replies

Author Message

Arnaud Lafon

Monday 01 December 2008 2:35:34 am

Hi Christophe,

Assuming $node is an "ezcontentobjecttreenode" php object :

$dataMap = $node->dataMap(); // or ->attribute( 'data_map' ); will return an array of ezcontentobjectattribute php object

each ezcontentobjectattribute has a "content" and this "content" is controlled by a datatype and its objectAttributeContent() method. So If you do :

$myImageAttribute = $dataMap['image_attribute']; // the attribute identifier is "image_attribute"
$myImageContent = $myImageAttribute->content(); // you'll get $myImageContent as an eZImageAliasHandler

this object is defined in kernel/classes/datatypes/ezimage/ezimagealiashandler.php

by using $myImageContent->attribute( 'something' ) you'll be able to access ImageVariation and in each image variation you'll have an attribute called "full_path" which is actually the same ez uses in its template to build the <img src=""/> tags.

Hope this helps.

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

Heath

Monday 01 December 2008 9:42:59 am

Take a look at these interesting articles on the subject.

http://74.125.95.132/search?q=cache:UBZrvOFxI6UJ:ezpedia.org/wiki/ez/solution_fetching_ezimage_datatype_image_alias_properties_using_php+ezImage+site:ezpedia.org&hl=en&ct=clnk&cd=1&gl=us

http://74.125.95.132/search?q=cache:lWM2xQ45PjUJ:ezpedia.org/wiki/en/ez/ezimagealiashandler+ezImage+site:ezpedia.org&hl=en&ct=clnk&cd=3&gl=us

hth,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Christophe Saint-Pierre

Thursday 04 December 2008 9:14:50 am

Thanks a lot , both of you.

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.