Forums / Setup & design / Changing the placement of an object during publish

Changing the placement of an object during publish

Author Message

James Packham

Tuesday 13 January 2004 3:32:37 am

Hi I'm trying to create a customised edit.tpl, where instead of using the default method of searching for a folder node my users can choose a location from a drop down box.

I've looked in edit_placement.tpl at the example, but am struggling to understand it. At the moment I can create the drop down box with the names of the appropiate locations and have a piece of code like this (just the select statement provided here for simpicity) :

<select name="location">

{section name=Folder loop=$FolderList}

<option value="{$Folder:item.node_id}">{$Folder:item.name|wash}</option>

{/section}

</select>

What do I need to change "location" to? Is there any documentation on this? I couldn't find any...

Thanks,

~James~

James Packham

Wednesday 14 January 2004 6:11:42 am

Ok, I got a little further:

<select name="SetPlacementNodeIDArray[]">
<option value="0">Please select a Region</option>
{section name=Folders loop=fetch( 'content', 'list', hash(
'parent_node_id', 53,
'class_filter_type', include,
'class_filter_array', array('folder') ) ) }
<option value="{$:item.node_id}">{$:item.name} node id {$:item.node_id}</option>
{/section}
</select>

lets me set the node ID to one of the subfolders inside the folder where I first create the new object. Unfortunately I get this message:

Location did not validate
* No main node selected, please select one.

I'm not 100% sure what the main node is hmmm Is it the node id for the new object? How do I input it?

At the moment I'm using code borrowed from the how to build an ez publish site tutorial to define it:

<input type="hidden"
name="MainNodeID"
value="{$main_node_id}" />

Is there another way I should be doing this?

Thanks,

~James~

James Packham

Wednesday 14 January 2004 8:00:33 am

It turns out I had to change the input bit to:

<input type="hidden"
name="MainNodeID"
value="{$object.current.temp_main_node.parent_node_id}" />

Because Main node id is the new parent node id.

~James~

James Packham

Thursday 15 January 2004 1:56:29 am

Um ok I thought this was working properly, but it turns out it's not :( The user has to make their selection twice because the first time they do object.current.temp_main_node.parent_node_id doesn't exist! It seems to get added as an object variable after the form is posted. *Doh* On the brightside it works the second time (so long as I don't change my mind about where I want to put the new object!!)

Could anyone help me out? This is the select statement I use to get my new placement node, (it's what I need to set my main_node_id).

<select name="SetPlacementNodeIDArray[]">

<option value="0">Please select a Region</option>
{section name=Folders loop=fetch( 'content', 'list', hash(
'parent_node_id', 53,
'class_filter_type', include,
'class_filter_array', array('folder') ) ) }
<option value="{$:item.node_id}">{$:item.name} node id {$:item.node_id}</option>
{/section}

</select>

I thought the obvious thing to do would be to move my input inside the select statement and change the value to $SetPlacementNodeIDArray[0]. But this doesn't work either (probably because it's an http variable). Maybe somebody who's done this/something similar could give me some pointers?

I'm trying to do it without having to rely on a bit of javascript to update a variable I can use in the input statement, because that sounds a bit unstable (i.e. what if the user has javascript disabled?).

Thanks!

~James~

eZ debug

Timing: Jan 19 2025 07:11:05
Script start
Timing: Jan 19 2025 07:11:05
Module start 'content'
Timing: Jan 19 2025 07:11:07
Module end 'content'
Timing: Jan 19 2025 07:11:07
Script end

Main resources:

Total runtime1.8404 sec
Peak memory usage4,096.0000 KB
Database Queries195

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0094 590.5313180.8125
Module start 'content' 0.00951.6231 771.3438501.1563
Module end 'content' 1.63250.2078 1,272.5000336.7422
Script end 1.8403  1,609.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.2223210.0002
Check MTime0.00150.0827210.0001
Mysql Total
Database connection0.00080.041710.0008
Mysqli_queries1.755795.39901950.0090
Looping result0.00250.13441930.0000
Template Total1.802798.020.9014
Template load0.00200.109720.0010
Template processing1.800797.843620.9004
Template load and register function0.00010.005710.0001
states
state_id_array0.00120.062510.0012
state_identifier_array0.00180.097220.0009
Override
Cache load0.00180.0972640.0000
Sytem overhead
Fetch class attribute can translate value0.00130.069820.0006
Fetch class attribute name0.00130.072550.0003
XML
Image XML parsing0.00060.035220.0003
class_abstraction
Instantiating content class attribute0.00000.001080.0000
General
dbfile0.00440.2396270.0002
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs