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

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

eZ debug

Timing: Jan 18 2025 15:14:34
Script start
Timing: Jan 18 2025 15:14:34
Module start 'layout'
Timing: Jan 18 2025 15:14:34
Module start 'content'
Timing: Jan 18 2025 15:14:35
Module end 'content'
Timing: Jan 18 2025 15:14:35
Script end

Main resources:

Total runtime0.8157 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.1797152.6406
Module start 'layout' 0.00510.0026 741.820339.4766
Module start 'content' 0.00770.8069 781.2969533.0391
Module end 'content' 0.81460.0011 1,314.335912.1250
Script end 0.8157  1,326.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3705160.0002
Check MTime0.00130.1551160.0001
Mysql Total
Database connection0.00070.081110.0007
Mysqli_queries0.770594.4601540.0143
Looping result0.00050.0615520.0000
Template Total0.788596.720.3943
Template load0.00200.249020.0010
Template processing0.786596.414920.3932
Template load and register function0.00010.015210.0001
states
state_id_array0.00110.131110.0011
state_identifier_array0.00080.094920.0004
Override
Cache load0.00170.2066260.0001
Sytem overhead
Fetch class attribute can translate value0.00130.156920.0006
Fetch class attribute name0.00080.102630.0003
XML
Image XML parsing0.00070.082020.0003
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.00060.0740160.0000
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs