How to embed a new node edit/create form in a page

Author Message

Tuomo Syvänperä

Tuesday 23 September 2008 4:08:39 am

We have a site which has one section under which the pages all have a form displayed on the right column of the site. The form, once submitted, should create a new forum topic under a certain forum node. How can I achieve this? It seems that when I normally click the new topic - button on a forum view, ez creates a new topic node and the displays the edit form for that node. Now I would need a way to post the form and get the node created once it is posted.
Any way to achieve this ?

And also relating to this, how can I get a feedback form to come back to the same page it was displayed once it is submitted. Now, if I submit a information collector form, user is redirected to the "thank you page". But I have a page where the form is embedded in the page in the same way as above. And I need the form submit to come back to that page so I can just display a thank you - text above the form on the right column.

Ivo Lukac

Tuesday 23 September 2008 5:17:54 am

Hello Tuomo,

First part is tricky because edit form creates draft, so in your case every page view would create draft (it will slow down your web). Maybe there is some solution which uses AJAX or something similar to post custom form for object creation. Don't know of such solution yet, maybe someone else does.

For second part you have DisplaySettings section in collect.ini

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

André R.

Tuesday 23 September 2008 5:24:22 am

You should probably look into using the powercontent extension.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Tuomo Syvänperä

Tuesday 23 September 2008 5:39:12 am

Okay, thanks for these.. I'll take a look at that powercontent extension.
I was thinking about a way to circumvent this problem. I was thinking that maybe I could make the form that submits the topic information as a standard information collector and submit the info that way. But that would require that I have a workflow set up so that when that information is collected, the workflow would automatically create the topic node using the collected information. But that would require a trigger which gets fired when information collectors are sent. Is there such a trigger or how could I create one ?

Tuomo Syvänperä

Tuesday 23 September 2008 6:15:42 am

The powercontent - extension works pretty well. Now only problem is that if there are validation errors when the form is submitted, the user gets redirected to the edit page. Instead the user should stay on the same page and the errors should be shown on the right column above the form. Anyway to achieve this with powercontent ? Or do I have to start thinking about using ajax to submit and display the form ?

Wei Dai

Wednesday 24 September 2008 4:34:56 am

Hi, I also have questions on the second part.

Actually, embedded a form to another page, so one form can be used anywhere is very common. However, I don't know how to enable the validation function, as I have posted a message just before this to ask:

"validate when the form template is not loaded as full view?"
(http://ez.no/developer/forum/setup_design/validate_when_the_form_template_is_not_loaded_as_full_view). I really don't have a clear clue on how the name space in eZ template language works; some docs on some deprecated tags but not all.

And, I knew the DisplaySettings section in collect.ini, just specify the result as node. But, there is also no information on how to write "thank you" message in the same node template page. How do I check if the form has successfully submitted to "content/action"?

Really wish someone can shed some light on this. Thanks!

Certified eZ Publish 4 developer looking for develop information & collaboration.

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

Main resources:

Total runtime0.7847 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.1406152.6406
Module start 'layout' 0.00650.0033 740.781339.4766
Module start 'content' 0.00980.7735 780.2578661.3750
Module end 'content' 0.78330.0014 1,441.632816.1250
Script end 0.7847  1,457.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4350160.0002
Check MTime0.00140.1813160.0001
Mysql Total
Database connection0.00090.117510.0009
Mysqli_queries0.724292.2859700.0103
Looping result0.00110.1393680.0000
Template Total0.752395.920.3762
Template load0.00240.311020.0012
Template processing0.749995.561420.3749
Template load and register function0.00010.015310.0001
states
state_id_array0.00120.148610.0012
state_identifier_array0.00120.155020.0006
Override
Cache load0.00210.2700290.0001
Sytem overhead
Fetch class attribute can translate value0.00060.080840.0002
Fetch class attribute name0.00120.151990.0001
XML
Image XML parsing0.00270.343040.0007
class_abstraction
Instantiating content class attribute0.00000.0022110.0000
General
dbfile0.00210.2692290.0001
String conversion0.00000.001240.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs