Forums / Setup & design / How to add a usefull new button to a template?

How to add a usefull new button to a template?

Author Message

christian bencivenni

Monday 05 March 2007 2:52:13 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:06:47 am

Have a look at the powercontent contrib. Will probably comes handy.

X+

http://www.sydesy.com