Forums / Setup & design / How to change a content object Section outside edit view

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]

eZ debug

Timing: Jan 18 2025 11:21:37
Script start
Timing: Jan 18 2025 11:21:37
Module start 'content'
Timing: Jan 18 2025 11:21:38
Module end 'content'
Timing: Jan 18 2025 11:21:38
Script end

Main resources:

Total runtime1.0594 sec
Peak memory usage4,096.0000 KB
Database Queries200

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 587.9688180.7969
Module start 'content' 0.00750.9007 768.7656575.3203
Module end 'content' 0.90820.1511 1,344.0859337.3359
Script end 1.0593  1,681.4219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.3615210.0002
Check MTime0.00150.1388210.0001
Mysql Total
Database connection0.00130.118010.0013
Mysqli_queries0.970891.64102000.0049
Looping result0.00240.22181980.0000
Template Total1.017196.020.5085
Template load0.00170.160320.0008
Template processing1.015495.847320.5077
Template load and register function0.00010.013910.0001
states
state_id_array0.00310.295510.0031
state_identifier_array0.00150.137620.0007
Override
Cache load0.00140.1355390.0000
Sytem overhead
Fetch class attribute can translate value0.00170.164230.0006
Fetch class attribute name0.00140.134970.0002
XML
Image XML parsing0.00380.355930.0013
class_abstraction
Instantiating content class attribute0.00000.0020100.0000
General
dbfile0.00560.5289330.0002
String conversion0.00000.000830.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0007 secs