eZ Community » Forums » Developer » Feedback form and file upload
expandshrink

Feedback form and file upload

Feedback form and file upload

Monday 07 November 2005 5:33:14 pm - 12 replies

I want to edit the standard feedback-form class adding a field to allow user to upload a file from the front-end interface. There is a simply way to do it? If I add a "file" field in the class, the checkbox "collect information" is disabled. There is a simple way to do it?

Thanks,

Salvatore

Monday 07 November 2005 10:08:05 pm

Hi Salvatore,

Look at
http://ez.no/community/forum/setu..._to_send_a_file_with_a_feedback_form

Tuesday 08 November 2005 3:12:47 pm

Thank you Luke,

I created a custom class and I used your notification extension.

Bye!

Tuesday 08 November 2005 3:41:39 pm

Very nice blunk.gif Emoticon Good to see that is useful for someone blunk.gif Emoticon

Sunday 10 September 2006 6:01:58 pm

hi Guarino,

Could it be possible for you to let me know, how have you created custom class for the file to be uploaded from the user end.

Please help.
Smith

Sunday 10 September 2006 6:42:57 pm

Hi,
just create a new class named "my form" with at least two attributes <name>,<file>.
Edit the anonymous role and allow the anonymous users to create objects of that class at a specific subtree.

Then create a button like:

    <form method="post" action="/content/action">
                <input class="button" type="submit" name="Feedback" value="Feedback" />
                <input type="hidden" name="RedirectURIAfterPublish" value="/" />
                <input type="hidden" name="ContentNodeID" value="5512" />
                <input type="hidden" name="ContentObjectID" value="5846" />
                <input type="hidden" name="NodeID" value="5512" />
                <input type="hidden" name="ClassIdentifier" value="my_form" />
            </div>
    </form>

Now you can see the standard edit.tpl when you klick on that button.
Then simply create a new overrride edit.tpl template for that class.

Monday 11 September 2006 10:25:13 am

hi leutner,

Thank you very much for your help. Much Appreciated.

One more thing on which i would like some help from you.

What i am trying to achieve is to allow users to register first and after registering, they can upload a file, but each user can only see/edit their own uploaded files.

Another thing, on the administration end, the administrator must be able to know, who has uploaded what. Is their any solution. At the moment all the files which are uploaded by the different users from the user end, are going into same folder and the administrator can't tell who has uploaded what.

Please help

Smith

Modified on Monday 11 September 2006 10:52:42 am by John Smith

Monday 11 September 2006 11:23:03 am

Hey John,

at first you need to create a new section within the admin panel under /section/list
called "members_only". Then assign this section to the part / subtree of your site which should be only visible for registered users.

Then go to the create a new role under /role/list called "Guest accounts" like:

  content  read  Section( members_only ) , Owner( Self )    
  content  create  Class( my_form ) , Section( members_only )    
  content  edit  Class(  my_form ) , Section( members_only ) , Owner( Self )  

Now assign this role to the "Guest accounts" user group where all standard registered users are placed. All users which want to access the section "members_only" are now asked for their login data.

Reguarding the creator:
If anyone publishes something, the creator is stored. Within the admin panel list view, just click on the "Detailed view" button to show the creator of each object.

Monday 11 September 2006 1:18:29 pm

Thanks Leutner,

The Roles which i have given are given below:

content  read  Section( Members Only ) , Owner( Self )  
content  create  Class( My Form ) , Section( Members Only )  
content  edit  Class( My Form ) , Section( Members Only ) , Owner( Self )  
user  login  SiteAccess( news )  
content  read  Section( Standard , Members Only )

Everything working fine, but the user can see other files as well which are uploaded by other users.

Thanks in advance.

 

Monday 11 September 2006 4:03:37 pm

Change

content read Section( Standard , Members Only ) 

to:

content read Section( Standard ) 

Monday 02 October 2006 11:08:18 am

Hey Leutner,
Regrading this post, I want to know that should the form "my_form" attributes will be declared as informatin collector ? In addition to this, I want to to send the newly created object information say 'feedback' to two different e-mail addresses.
Plz, guide me regarding this, and I am also new to ez publish.

Thanks.

Friday 16 March 2007 4:52:14 am

Hi Everyone,

I have tried following the examples here, and also tried searching through the threads, but I am still unable to get the default edit page to show. Can anyone kindly provide a step-by-step instructions for this newbie here to get the page to work?

I have created the following:
- feedback class "my_feedback", ID 29
- "myfolder", under the eZ publish content structure, Node ID 470, section "Feedback"
- assigned the rights to user "Anonymous":
content create Class( my_feedback ) , Section( Feedback )
content edit Class( my_feedback ) , Section( Feedback ) , Owner( Self )
content read Section( Feedback )

<form method="post" action="/myweb/index.php/web/content/action">
<input class="button" type="submit" name="Feedback" value="Feedback" />
<input type="hidden" name="ContentNodeID" value="470" />
<input type="hidden" name="ContentObjectID" value="29" />
<input type="hidden" name="NodeID" value="470" />
<input type="hidden" name="ClassIdentifier" value="my_feedback" />
</form>

I tried using the above form, but I get a blank page, except for the headers and footer specified in the base template. If I submit the form by specifying ClassIdentifier and NodeID, I get "Object Not Found". Can anyone enlighten me what went wrong?

Friday 16 March 2007 10:53:03 am

Hello,

To created content into frontoffice :

First I created a button :
<form method="post" action="/content/action">
<input type="hidden" name="ClassID" value="<class_id>" />
<input type="hidden" name="ContentLanguageCode" value="<fre-FR>" />
<input type="hidden" name="ContentObjectLanguageCode" value="<fre-FR>" />
<input type="hidden" name="ContentObjectID" value="{$content_object.id}" />
<input type="hidden" name="NodeID" value="{$current_node.node_id}" />
<input type="hidden" name="ContentNodeID" value="{$current_node.node_id}" />
<input class="button" type="submit" name="NewButton" value="<CreateNewContent>" />
</form>

Chang all text in <>.

After clic on button, you redirected :

<form enctype="multipart/form-data" method="post" action={concat("/content/edit/",$object.id,"/",$edit_version,"/",$edit_language|not|choose(concat($edit_language,"/"blunk.gif Emoticon,''))|ezurl}>
{def $attributes=$content_attributes}
{foreach $attributes as $attribute}
<p>{$attribute.contentclass_attribute.name} : {attribute_edit_gui attribute=$attribute}</p>
{/foreach}
<input class="defaultbutton" type="submit" name="PublishButton" value="Envoyer pour publication" />
<input class="button" type="submit" name="DiscardButton" value="Abondonner" />
</form>

I you like to know how I can redirect the post of new content with
<input type="hidden" name="RedirectURIAfterPublish" value="<which_value??>" />
on page on "Thank you for your post".

Modified on Friday 16 March 2007 10:53:35 am by Stéphane Bullier

expandshrink

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

36 542 Users on board!

Forums menu