Forums / Developer / Create a hidden node

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