eZ Community » Forums » Setup & design » feedback validation in embed view
expandshrink

feedback validation in embed view

feedback validation in embed view

Monday 12 May 2014 11:52:53 am - 1 reply

Hi guys,

is there a possibility to integrate the feedback form validation into an embed view?

This only works in full view at the moment.

This template snippet won´t work in embed view:

{section show=and($validation.processed,$collection_attributes)}        
 
{section show=$validation.attributes}

If have insert a tweak in my parent full node view at the moment like this: 

{foreach $node.data_map.content.object.embedded_contentobject_array as $item}  
 
{if $item.class_identifier|eq('CLASSNAME')}
 
{include name=Validation    uri='design:content/collectedinfo_validation.tpl'    
             class='message-warning'                                  
  validation=$validation collection_attributes=$collection_attributes}

Now I can embed my form without the validation. It will work, but it isn´t a correct solution.

Can anyone help this topic?

Best

marikunt

Modified on Monday 12 May 2014 11:57:39 am by Marius L

Monday 26 May 2014 2:12:59 pm

you can just take attributes one by one after fetching form and show them and validate them as follow:

even though it is not written based on best practice and maintainability it does what you want:

 {include name=Validation uri='design:content/collectedinfo_validation.tpl'                 class='message-warning'                               validation=$validation collection_attributes=$collection_attributes}                <form name="contact_form" method="post" action={"content/action"|ezurl} >                    {attribute_view_gui attribute=$form.data_map.sender_name}                    {attribute_view_gui attribute=$form.data_map.email}                       <div style="clear:both;"></div>               {attribute_view_gui attribute=$form.data_map.message}                    <div class="content-action">                      <input class="hidden" type="text" size="70" name={concat('ContentObjectAttribute_ezstring_data_text_',$form.data_map.subject.id)} value="Contact from your website">                               <input type="submit" class="defaultbutton" name="ActionCollectInformation" value="Send" />                        <input type="hidden" name="ContentNodeID" value="{$form.node_id}" />                        <input type="hidden" name="ContentObjectID" value="{$form.object.id}" />                        <input type="hidden" name="ViewMode" value="full" />                    </div>                </form>

All you need to fetch is just $form variable

Modified on Monday 26 May 2014 2:17:03 pm by Amir Koklan

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from