Monday 24 January 2011 5:48:48 am
Hi, i am trying to create a page with content from php. So i read David Linnards wonderful tutorial about how to create objects in php, and it works in general, but i want to fill up the content with html or ezxml from inside the script. Here is what i have so far:
$parentNode = eZContentObjectTreeNode::fetchByURLPath( $parentURL );
$user = eZUser::currentUser();
$p = array();
$p['class_identifier'] = 'folder';
$p['creator_id'] = $user->attribute( 'contentobject_id' );
$p['parent_node_id'] = $parentNode->attribute( 'node_id' );
$p['section_id'] = $parentNode->attribute( 'object' )->attribute( 'section_id' );
$attr = array ( ) ;
$attr['name'] = $fullName;
$attr['short_name'] = $shortName;
$attr['summary'] = '<p>AGGI</p>';
$attr['description'] = '<p>AGGI</p>';
$attr['tags'] = 'AGGI';
$p['attributes'] = $attr; $o = eZContentFunctions::createAndPublishObject( $p ); Well, after this, the new folder is created and 'Name', 'Short Name' and 'Tags' are filled, but summary and description are both blank, what am i doing wrong?
|