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

eZ debug

Timing: Jan 30 2025 21:13:37
Script start
Timing: Jan 30 2025 21:13:37
Module start 'content'
Timing: Jan 30 2025 21:13:37
Module end 'content'
Timing: Jan 30 2025 21:13:37
Script end

Main resources:

Total runtime0.2911 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 588.0625370.2734
Module start 'content' 0.00850.0159 958.33591,001.7031
Module end 'content' 0.02440.2666 1,960.03913,897.0391
Script end 0.2910  5,857.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00481.6468200.0002
Check MTime0.00130.4577200.0001
Mysql Total
Database connection0.00100.331910.0010
Mysqli_queries0.192666.15271410.0014
Looping result0.00130.46071390.0000
Template Total0.266291.410.2662
Template load0.00090.293710.0009
Template processing0.265391.141510.2653
Override
Cache load0.00060.208210.0006
Sytem overhead
Fetch class attribute can translate value0.00210.733810.0021
XML
Image XML parsing0.00020.060110.0002
General
dbfile0.00782.6804200.0004
String conversion0.00000.002830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs