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!
|