Create a hidden node

Author Message

Issam Mouzoun

Thursday 10 September 2009 4:03:30 am

Hello,
I would like develop a code that create a hidden node in front-office, this is my code,

   $nodeAssignment = eZNodeAssignment :: create(array (
						'contentobject_id' => $object->attribute('id'),
						'contentobject_version' => $object->attribute('current_version'),
						'parent_node' => $catNodeId,
						'is_main' => 1
					));
					$nodeAssignment->store();				
					
					//Publication de l'objet
					$object->setAttribute('status', EZ_VERSION_STATUS_DRAFT);
					$object->store();
					$operationResult = eZOperationHandler :: execute('content', 'publish', array (
						'object_id' => $object->attribute('id'),
						'version' => $object->attribute('current_version')
					));
 

Ivo Lukac

Thursday 10 September 2009 7:00:25 am

Just put this in your edit template

{if $edit_version|eq(1)}
        <input name="FutureNodeHiddenState_{$main_node_id}" type="hidden" value="hidden" />
        <input type="hidden" name="MainNodeID" value="{$main_node_id}" />
{/if}

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

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

eZ debug

Timing: Jan 31 2025 06:16:37
Script start
Timing: Jan 31 2025 06:16:37
Module start 'layout'
Timing: Jan 31 2025 06:16:37
Module start 'content'
Timing: Jan 31 2025 06:16:37
Module end 'content'
Timing: Jan 31 2025 06:16:37
Script end

Main resources:

Total runtime0.0144 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.0313151.1953
Module start 'layout' 0.00510.0027 739.226636.6172
Module start 'content' 0.00790.0053 775.843890.2500
Module end 'content' 0.01320.0012 866.093829.9922
Script end 0.0144  896.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002215.3992140.0002
Check MTime0.00117.3533140.0001
Mysql Total
Database connection0.00096.067110.0009
Mysqli_queries0.002517.674030.0008
Looping result0.00000.097510.0000
Template Total0.00096.410.0009
Template load0.00075.007410.0007
Template processing0.00021.393610.0002
Override
Cache load0.00053.425410.0005
General
dbfile0.00139.104080.0002
String conversion0.00000.057940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs