How to create a usefull button to publish?

Author Message

christian bencivenni

Monday 05 March 2007 2:43:14 am

Hi to you all.
I have a problem to resolve. I'm searching a way to create a new object class in the flavour of a feedback form but little more complex.
This is my work:
1. I created a new class called New_feedback_form with 10 attributes: a required text field (called Name) and 9 other (a mix of Text Line, date and Multi Option attributes) also required but all Content Collector.
2. Then I create an istance of the class: an object named New Feedback and I publish it as home page child. Becouse all exept one of its fields are content collector when an end-user open the page he will find a form to compile. And when I publish it I decided the MultiOption options (for example sex: male or female, study title: basic, scolastic, university, and so on).
3. Now I have my problem: I need to create a new object every time an end-user compile the form. I mean that a user will connect to the page, fill all form fields, and click on a "Send" button. When the button will be hit I need to generate a new object in a hidden directory. Something similar of the forum replay but hidden.

I tried in a lot of ways:

1. as write in "eZ publish basics" book (page 149) I add the code lines:

<form method="post" action={'/content/action'|ezurl}>
<div class="buttonblock">
	<input class="button" type="submit" name="NewButton" value="Send the feed form" />
	<input type="hidden" name="ClassID" value="137} />
	<input type="hidden" name="NodeID" value="38}" />
	</div>
</form>

Where 137 is the ID of the class New_feedback_form and 38 is the node ID of the hidden directory. But by this way when a user click on the "Send the feed form" another feed is open, but through the administrator interface. It's not good becouse I have the need to have the MultiOption options ready to choose and not to create.

2. Then I tried to use the reply-to-forum template. I thinked that the the procedure is the same. But adding the code:

<div class="buttonblock">
	<input class="button" type="submit" name="NewButton" value="{'Create here'|i18n('design/standard/node/view')}" />
	<input type="hidden" name="ContentNodeID" value="{$node.node_id} />
	<input type="hidden" name="ContentObjectID" value="{$content_object.id}" />
	</div>
</form>

Nothing appens. No object are created.
3. I also tried with:

type="submit" name="PublishButton"

but nothing at all. I receive an error about the wrong ID of the object.

My question is: there is a way to obtain a mix between a feedback-form and a reply-to-forum form? And how I must add a button to publish the information from the users?

Thank you a lot.

Christian

Xavier Dutoit

Monday 05 March 2007 3:07:43 am

Please avoid Xposting. See the thread at

http://ez.no/community/forum/setup_design/how_to_add_a_usefull_new_button_to_a_template

http://www.sydesy.com

christian bencivenni

Monday 05 March 2007 3:56:30 am

sorry...
I tried to stop the first post but it was too late.
I will take a look to your powercontent.
thanks.

christian bencivenni

Monday 05 March 2007 4:13:07 am

I just read the documentation of power content but I'm not sure it is a correct solution for my problem.
I don't need to prefill attributes or create a new object without a draft.
I need to create an object with informations filled in a form fields. I think that the real problem is in the MultiOptions Datatype. I need to have a front end published object (with the options of the datatype choosed by the admin) and a button to submit the choises of the end-user for the creation of a new object.
Exactly like the forum replies but with the addition of MultiOptions datatype.
Do you think that there is a way to do it?

Xavier Dutoit

Monday 05 March 2007 9:09:53 am

Hi,

Might have misread your question, don't get why you want to have everything as information collector. If you want them to be stored as content into a normal node, the attributes shouldn't be information collector.

The powercontent is to avoid to create empty draft everytime someone wants to start filling the survey but stops in the middle (before "send for publishing")... and because that's much quicker to display the form.

X+

http://www.sydesy.com

christian bencivenni

Tuesday 06 March 2007 4:03:24 am

But ... How I can have it?
I need that a final logged user will see a form with options and fields to fill.
How can I have an object with Multioption attibutes rady to choose but in edit form?

christian bencivenni

Tuesday 06 March 2007 4:10:51 am

If I don't set the attributes to Information Collector and add a policy to the user to open a new object and publish it in edit-mode, how I can make a multioption menu in the page?

christian bencivenni

Tuesday 06 March 2007 5:40:58 am

Correct me if I'm doing an error but... if an attribute is not Information collector it cannot be altered from the front end...

christian bencivenni

Wednesday 07 March 2007 4:05:26 am

ok. I trying a new way.
I will create a class type and I will add a policy to create this class objects to all registered users.
Is correct?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.