Forums / Setup & design / How to embed a new node edit/create form in a page

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.

eZ debug

Timing: Jan 30 2025 21:20:05
Script start
Timing: Jan 30 2025 21:20:05
Module start 'content'
Timing: Jan 30 2025 21:20:05
Module end 'content'
Timing: Jan 30 2025 21:20:05
Script end

Main resources:

Total runtime0.2079 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.0079 588.0781370.2734
Module start 'content' 0.00790.0147 958.35161,009.5781
Module end 'content' 0.02260.1853 1,967.92973,898.5391
Script end 0.2079  5,866.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00472.2530200.0002
Check MTime0.00130.6412200.0001
Mysql Total
Database connection0.00060.275610.0006
Mysqli_queries0.113254.41921410.0008
Looping result0.00120.59671390.0000
Template Total0.184988.910.1849
Template load0.00080.374110.0008
Template processing0.184188.542210.1841
Override
Cache load0.00050.246710.0005
Sytem overhead
Fetch class attribute can translate value0.00200.938210.0020
XML
Image XML parsing0.00030.126010.0003
General
dbfile0.00432.0604200.0002
String conversion0.00000.003930.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