Edit content from Frontend layout

Author Message

Robin Sørlie

Wednesday 13 October 2004 6:59:03 am

To get an edit link I use the following:
{section show=$node.object.can_edit}
<a href={concat("content/edit/",$node.object.id)|ezurl}>[Edit]</a>
{/section}

When I enter this, I get the /content/edit and the right object ID. I can change the content in the forms as I do in adnin. But when I click "Send for publish" button, I get the following error:

Den plasseringen ble ikke validert
- Ingen hovednode er valgt, vennligst velg en hovednode.

Translated into english this should be something like this:

That placement was not validated.
- No main node is chosen, please choose a main node.

Now I'm stuck, and don't understand why this doesn't work.

Ole Morten Halvorsen

Wednesday 13 October 2004 7:30:46 am

Hi,

The object doesn't have a main placement. You can set this as a hidden variable. Normally edit_placement.tpl would take care of this, but I guess you don't include that file.

The solution is documented in the Bulding an eZ publish site tutorial:
http://ez.no/ez_publish/documentation/building_an_ez_publish_site/the_guestbook/the_input_template

Basicly what you have to do is add this to your edit template:

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

Ole M.

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Robin Sørlie

Wednesday 13 October 2004 8:04:01 am

After my last message, I came to think of the edit_placement.tpl

I use the standard edit.tpl as an override, and had commented out edit_placement and edit_right_menu cause the users don't need this to edit the content, and will only cause confusion.

When I used the edit_placement, it worked, and also using your suggestion with an hidden form field. So this is great, thanks.

But I now have a bigger problem. I tried to edit a few objects before, and got that error I described. On those objects the error still apperes, but not only at the frontend, but ALSO in admin! So I have no possibility to change this objects anymore. This has probably something to do with cache, but I have cleared all cahce through admin, but it's still the same. Any suggestion on this? Delete the /var/cache/ ?

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 19 2025 06:13:46
Script start
Timing: Jan 19 2025 06:13:46
Module start 'layout'
Timing: Jan 19 2025 06:13:46
Module start 'content'
Timing: Jan 19 2025 06:13:47
Module end 'content'
Timing: Jan 19 2025 06:13:47
Script end

Main resources:

Total runtime0.6931 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 589.1797152.6250
Module start 'layout' 0.00740.0049 741.804739.4453
Module start 'content' 0.01230.6796 781.2500503.8359
Module end 'content' 0.69180.0012 1,285.085912.4688
Script end 0.6930  1,297.5547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4791160.0002
Check MTime0.00130.1921160.0001
Mysql Total
Database connection0.00100.146010.0010
Mysqli_queries0.639392.2481570.0112
Looping result0.00050.0656550.0000
Template Total0.646893.320.3234
Template load0.00210.305220.0011
Template processing0.644793.020620.3223
Template load and register function0.00010.020210.0001
states
state_id_array0.00080.108610.0008
state_identifier_array0.00060.080520.0003
Override
Cache load0.00170.2441270.0001
Sytem overhead
Fetch class attribute can translate value0.00050.072820.0003
Fetch class attribute name0.00100.143530.0003
XML
Image XML parsing0.00020.034420.0001
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00831.2035100.0008
String conversion0.00000.001440.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs