Share » Forums » Developer » How to use the node_view_gui output...

How to use the node_view_gui output into PHP ?

How to use the node_view_gui output into PHP ?

Monday 19 May 2008 5:14:18 am - 3 replies

Author Message

Felix Laate

Monday 19 May 2008 5:57:06 am

Hi Sébastien,

having a look at kernel/content/view.php:

 $localVars = array( "cacheFileArray", "NodeID",   "Module", "tpl",
                        "LanguageCode",   "ViewMode", "Offset", "ini",
                        "cacheFileArray", "viewParameters",  "collectionAttributes",
                        "validation" );
 ...


        $cacheFileArray = array( 'cache_dir' => false, 'cache_path' => false );
        $args = compact( $localVars );
        $data = eZNodeviewfunctions::contentViewGenerate( false, $args ); // the false parameter will disable generation of the 'binarydata' entry
        return $data['content']; // Return the $Result array
  

Maybe the function <i>eZNodeviewfunctions::contentViewGenerate</i> does the trick?

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Sébastien Antoniotti

Monday 19 May 2008 6:42:39 am

Hi Felix,

You're right !

It's OK, this is the code I used to get the XHTML output of content/view/line/589 :

$cacheFileArray = array( 'cache_dir' => false, 'cache_path' => false );
$NodeID = 589;
$Module = $Params['Module'];
$tpl = templateInit();
$LanguageCode = $Params['Language'];
$ViewMode = "line";
$Offset = $Params['Offset'];
$ini = eZINI::instance();
$Year = $Params['Year'];
$Month = $Params['Month'];
$Day = $Params['Day'];
$viewParameters = array( 'offset' => $Offset,
				 'year' => $Year,
				 'month' => $Month,
				 'day' => $Day,
				 'namefilter' => false );
$viewParameters = array_merge( $viewParameters, $UserParameters );

$collectionAttributes = false;
if ( isset( $Params['CollectionAttributes'] ) )
	$collectionAttributes = $Params['CollectionAttributes'];

$validation = array( 'processed' => false,
			 'attributes' => array() );
if ( isset( $Params['AttributeValidation'] ) )
	$validation = $Params['AttributeValidation'];

$localVars = array( "cacheFileArray", "NodeID",   "Module", "tpl",
				"LanguageCode",   "ViewMode", "Offset", "ini",
				"cacheFileArray", "viewParameters",  "collectionAttributes",
				"validation" );

$args = compact( $localVars );
$data = eZNodeviewfunctions::contentViewGenerate( false, $args ); // the false parameter will disable generation of the 'binarydata' entry
$xhtmlContent = $data['content'];

return $xhtmlContent['content'];

Thanks a lot !

eZ Publish Freelance
web : http://www.webaxis.fr

*- pike

Thursday 05 November 2009 1:53:47 pm

Hi

I would have liked to paste some usefull code here, but its not working.

I gave up and removed my code. Sorry.

$0c,

*-pike

---------------
The class eZContentObjectTreeNode does.

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

36 542 Users on board!

Forums menu