How to change a content object Section outside edit view

Author Message

Benjamin Lorteau

Monday 30 March 2009 4:14:33 pm

Hello,

I was wondering if it was possible to change the section of a content object without having to enter the edit mode, with a special form with specific action URL and particular hidden fields ?

I tried to "copy" the "Assign Section" functionnality in the edit form with something like that :

<form action="{concat('content/edit/', $node.contentobject_id,'/',$node.object.current_version)|ezurl('no')}" method="post">
  <input type="hidden" name="SelectedSectionId" value="6"/>
  <input type="submit"name="SectionEditButton" value="Assign"/>
</form>

But it doesn't actually work.

Would another approach based on section-side assignment (like in Administration -> Section page) work ? How can I skip the browse part in this case ?

Thanks in advance,
Benjamin

eZ Publish personal project : http://www.aeriesguard.com [fr]

Olivier Portier

Tuesday 28 April 2009 5:04:33 am

Hi Benjamin,

May be this could help :
http://ez.no/developer/contribs/hacks/section_edit

The action from your form should be section/assign/<section_id>.
May be this would work better.

Regards
Olivier

Benjamin Lorteau

Tuesday 28 April 2009 5:17:25 am

Hi Olivier and thanks for the reply.

Unfortunately, the contribution you mention in your post has already been integrated in eZ Publish public version. No need for a hack to change section in the admin object edit view.

My need is slightly different, I need a way to change section outside this edit view, in the admin full view, for example.

Nevertheless, I will try your guess in the form action.

eZ Publish personal project : http://www.aeriesguard.com [fr]

Olivier Portier

Tuesday 28 April 2009 6:48:53 am

I did try with this :

<form action={'section/assign/1'|ezurl} method="post">
 <input type="hidden" name="SelectedNodeIDArray[]" value="{$node.node_id}"/>
 <input name="BrowseActionName" value="AssignSection" type="hidden" />
 <input type="submit" name="SelectButton" value="Assign"/>
</form>

The redirect URL is section/list but it is working fine.

Regards
Olivier

Benjamin Lorteau

Tuesday 28 April 2009 7:11:47 am

Great, thanks a lot !

I can't try it out myself right now, but is there a hidden field for the redirection page after section assignation ?

Like RedirectAfterURL or something ?

eZ Publish personal project : http://www.aeriesguard.com [fr]

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

Main resources:

Total runtime1.1340 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 588.1719152.6563
Module start 'layout' 0.00440.0024 740.828139.5078
Module start 'content' 0.00681.1260 780.3359570.2109
Module end 'content' 1.13270.0012 1,350.546916.0938
Script end 1.1339  1,366.6406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2962160.0002
Check MTime0.00140.1270160.0001
Mysql Total
Database connection0.00060.053810.0006
Mysqli_queries1.073494.6628630.0170
Looping result0.00060.0501610.0000
Template Total1.100097.020.5500
Template load0.00230.205420.0012
Template processing1.097796.799520.5488
Template load and register function0.00010.012810.0001
states
state_id_array0.00110.097110.0011
state_identifier_array0.00160.138520.0008
Override
Cache load0.00200.1776390.0001
Sytem overhead
Fetch class attribute can translate value0.00070.060620.0003
Fetch class attribute name0.00150.135670.0002
XML
Image XML parsing0.00410.363320.0021
class_abstraction
Instantiating content class attribute0.00000.0017100.0000
General
dbfile0.00410.3601220.0002
String conversion0.00000.000640.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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/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
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs