eZ Community » Forums » Developer » 2 Form collection
expandshrink

2 Form collection

2 Form collection

Wednesday 25 August 2010 1:08:03 pm - 2 replies

Hello,
anybody knows if it's possible to have two forms in the same page?
If it's possible, how I may configure the feedback options for both?

Thank you.

Thursday 26 August 2010 8:27:57 pm

Hi,

What is the purpose/goal of having 2 forms on one single page? Forms usually forward you to another page, so submitting one of the two will take you away from the second form? Or is there something specific that there needs to be 2 forms?

Thanks and regards, Robin

Thursday 26 August 2010 10:49:59 pm

There are usecases where this can make sense, a newsletter subscription AND unsusbcription form on one page for example.

If want your forms to use custom templates, create and place them somewhere under templates/node/view/*, for example as myform1_embed.tpl.

In the template that renders the multiform page fetch the two form objects. Then use something like this to display the forms.

{def 
     $myFormNode1=fetch( 'content', 'node', hash( 'node_id', 96 ) )
     $myFormNode2=fetch( 'content', 'node', hash( 'node_id', 97 ) )
}
 
<h2>My first form</h2> 
{node_view_gui content_node=$myFormNode1 view='myform1_embed'}
 
<h2>My second form</h2>
{node_view_gui content_node=$myFormNode2 view='myform2_embed'

Let me know if this helped.

Modified on Saturday 28 August 2010 5:22:28 pm by Patrick Kaiser

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from