Friday 09 December 2005 2:38:06 am
This is how I finally did it (to fetch the full view of a content node):
<?php
include_once( 'kernel/classes/ezcontentobject.php' );
include_once( 'kernel/classes/ezcontentobjecttreenode.php' );
include_once( 'kernel/common/template.php' );
include_once( 'lib/ezutils/classes/ezexecution.php' );
$nodeID = false;
$http =& eZHTTPTool::instance();
$module =& $Params["Module"];
$originalParameters=$module->OriginalUnorderedParameters;
if (array_key_exists('nodeID', $originalParameters) ) {
$nodeID = $originalParameters['nodeID'];
}
if ( !( $nodeID) ) {
eZDebug::writeError( "nodeid not set as param");
return $module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' );
}
$node =& eZContentObjectTreeNode::fetch( $nodeID);
if ( is_object( $node ) )
{
$tpl =& templateInit();
$tpl->setVariable( 'node', $node);
$tpl->setVariable( 'nodeid', $nodeID );
echo ($tpl->fetch( "design:resultonly.tpl" ));
eZExecution::cleanExit();
}
else {
return $module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' );
}
?>
whereas resultonly.tpl simply contains an appropriate node_view_gui call. But thanks for your inputs ;)
Visit http://triligon.org
|