Forums / Setup & design / Edit content from Frontend layout

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/ ?

eZ debug

Timing: Jan 31 2025 00:40:28
Script start
Timing: Jan 31 2025 00:40:28
Module start 'content'
Timing: Jan 31 2025 00:40:28
Module end 'content'
Timing: Jan 31 2025 00:40:28
Script end

Main resources:

Total runtime0.1841 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 587.9531370.2891
Module start 'content' 0.00720.0158 958.24221,001.5469
Module end 'content' 0.02300.1611 1,959.78913,890.7422
Script end 0.1841  5,850.5313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00472.5453200.0002
Check MTime0.00150.8267200.0001
Mysql Total
Database connection0.00100.538210.0010
Mysqli_queries0.088347.96111410.0006
Looping result0.00110.60861390.0000
Template Total0.160687.210.1606
Template load0.00090.480010.0009
Template processing0.159786.723510.1597
Override
Cache load0.00060.327510.0006
Sytem overhead
Fetch class attribute can translate value0.00180.990510.0018
XML
Image XML parsing0.00030.165110.0003
General
dbfile0.00784.2626200.0004
String conversion0.00000.002630.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs