How add object with custom main node?

Author Message

Andrey PAA

Saturday 08 April 2006 1:00:18 am

I have the main category:
Cat 1
Cat 2
Cat 3
and in main categories i hav any sub categories
i need that i select the main category than i click the button "create" (i do it)
then show the custom form for adding content object where showing the sub category of main category i.e.
Cat 1-1
Cat 1-2
Cat 1-3
and i can select only one (the radio button) (i do it)

the code of my template : edit_placement.tpl

<hr />
{$object.name} - {$node.name} - {$object.parent_nodes[0]}

{let children=fetch( content, tree,
        hash( parent_node_id, $object.parent_nodes[0],
	      class_filter_type,  'include',
              class_filter_array, array( '33' )  ) )
}
<table width="100%">
<tr>
<th>Main</th>
<th width="90%">Name</th>
</tr>


{def $cnt=0}
{foreach $children as $child}
{set $cnt=$cnt|inc(1)}
<tr>
<td> <input type="radio" name="MainNodeID" value="{$child.node_id}" id="my_{$child.node_id}" onChange='document.getElementById("hidmain").value={$child.node_id};' />

 </td>
<td><label for="my_{$child.node_id}">{$child.name} - {$cnt}</label></td>
</tr>
{/foreach}
{undef}    
<input id="hidmain" type="hidden" name="SetPlacementNodeIDArray[1]" value="" />
<input type="hidden" name="SetRemoteIDOrderMap[1]" value="1" />
<input type="hidden" name="SetRemoteIDFieldMap[1]" value="1" />

</table>
<hr />

 

then i click the button publish and the object is add to the system

but this object is placement in main category and in the sub category
but i need only sub category and without javascrpt
Help me please!

Andrey PAA

Saturday 08 April 2006 1:13:29 am

P.s.

code of "add button":

{* Grab main category. *}
{let children=fetch( content, tree,
        hash( parent_node_id, $view_parameters.root,
	      class_filter_type,  'include',
              class_filter_array, array( '33' )  ) )
}

{* $children *}{* LOOP: For each child of the node... *}
{foreach $children as $child}
    {* node_view_gui view=line content_node=$child *}
    <form method="post" action={"/content/action"|ezurl}>     
    <input type="hidden" name="NodeID" value="{$child.node_id}" />     
    <input type="hidden" name="ClassID" value="31" />     
    <input type="submit" name="NewButton" value="{'Create here'|i18n('design/standard/node/view')} in {$child.name|wash}" />   
    </form><br />
{/foreach}

{* End of namespace. *}
{/let}

and this code i dont't want to change

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 18 2025 16:11:52
Script start
Timing: Jan 18 2025 16:11:52
Module start 'layout'
Timing: Jan 18 2025 16:11:52
Module start 'content'
Timing: Jan 18 2025 16:11:52
Module end 'content'
Timing: Jan 18 2025 16:11:52
Script end

Main resources:

Total runtime0.7397 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.1641152.6406
Module start 'layout' 0.00550.0035 741.804739.4766
Module start 'content' 0.00900.7292 781.2813432.4922
Module end 'content' 0.73820.0015 1,213.773412.1406
Script end 0.7397  1,225.9141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4473160.0002
Check MTime0.00130.1802160.0001
Mysql Total
Database connection0.00070.098410.0007
Mysqli_queries0.697494.2880520.0134
Looping result0.00050.0659500.0000
Template Total0.707295.620.3536
Template load0.00210.287320.0011
Template processing0.705095.311020.3525
Template load and register function0.00020.030710.0002
states
state_id_array0.00100.132510.0010
state_identifier_array0.00200.263720.0010
Override
Cache load0.00170.2316260.0001
Sytem overhead
Fetch class attribute can translate value0.00080.111410.0008
Fetch class attribute name0.00100.139920.0005
XML
Image XML parsing0.00010.012410.0001
class_abstraction
Instantiating content class attribute0.00000.001020.0000
General
dbfile0.00080.1108100.0001
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs