Share » Forums » Developer » Coding an e-vite extension, accessing...

Coding an e-vite extension, accessing an object...

Coding an e-vite extension, accessing an object...

Monday 10 July 2006 10:15:59 am - 2 replies

Modified on Monday 10 July 2006 10:16:32 am by Andrew K

Author Message

Ɓukasz Serwatka

Monday 17 July 2006 11:19:41 pm

Hi Andrew,

In form where you triggering new action you need to define ContentObjectID hidden input form. Then in your PHP code you can fetch object and access contentobject attributes.

include_once ('lib/ezutils/classes/ezfunctionhandler.php');
 
// {def $object=fetch( 'content', 'object', hash( 'object_id', 2 ) )}
$object = eZFunctionHandler::execute( 'content','object', array( 'object_id' => $http->postVariable("ContentObjectID")) );
 
// {$object.data_map}
$dataMap =& $object->dataMap();
 
// {$object.data_map.body.content.output.output_text}
$body =& $dataMap['body']->content();
$bodyOutput =& $body->attribute('output');
$bodyOutputText = $bodyOutput->attribute('output_text');

Some more information:
http://ez.no/community/forum/developer/defining_methods_or_custom_actions_for_content_classes/re_defining_methods_or_custo

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

Andrew K

Tuesday 18 July 2006 7:00:26 am

Yup. That's what I'm looking for!
Thanks.

--Andrew

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

36 542 Users on board!

Forums menu