Forms

Author Message

Matthew Rat

Friday 11 April 2003 1:44:53 pm

I have created a new class in the admin interface and called it "Email Notification". It has a name, email_address, email_recipient, and note field. I have created an instance of this in my content folder (thus giving it a node_id). The email_address field is set up as an information collector. The idea is that this would be shown on a page as one of those "Join newsletter" sort of things, showing a text field to enter the email address and a submit button. Well, I used the following code to try to put the object in the page but met with a very long text box that I have (seemingly) no control over. Please see code below and let me know if I am going about this all wrong and/or a better method to get this under control. Thanks!

* Code *
{let tobject=fetch(content,node,hash(node_id,292))
newsletter=$tobject}
<form method="post" action={"content/action"|ezurl}>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td colspan="2" >
{attribute_view_gui attribute=$newsletter.data_map.email_address}
</td>
</tr>
<tr>
<td class="tinytext" align="center">Enter your email
address for relevant news</td>
<td align="right">
<input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
<input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
<input type="hidden" name="ViewMode" value="full" />
<input type="submit" name="{$newsletter.action}" value="Submit">
</td>
</tr>
<tr>
<td colspan="2" class="tinytext" align="center">
<hr size="1" noshade width="80%">
</td>
</tr>
<tr>
<td colspan="2" class="tinytext" align="center">Yes,
your privacy is protected</td>
</tr>
</table>
</form>
{/let}
* /Code *

Jan Borsodi

Monday 14 April 2003 7:53:47 am

You're using the attribute_view_gui to show the email field, this means that the system will use the default template for text inputs (assuming you are using Text line datatype).
To solve this you should copy the template code from design/standard/templates/content/datatype/view/ezstring.tpl and replace it with the attribute_view_gui code (you probably need to tweak the code to use your variables).

You will now be able to tweak the result to your liking.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

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 30 2025 19:44:02
Script start
Timing: Jan 30 2025 19:44:02
Module start 'layout'
Timing: Jan 30 2025 19:44:02
Module start 'content'
Timing: Jan 30 2025 19:44:02
Module end 'content'
Timing: Jan 30 2025 19:44:02
Script end

Main resources:

Total runtime0.0291 sec
Peak memory usage8,192.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 588.0000151.1953
Module start 'layout' 0.00630.0048 739.1953220.6328
Module start 'content' 0.01110.0161 959.8281997.7422
Module end 'content' 0.02730.0018 1,957.570333.9922
Script end 0.0291  1,991.5625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003110.7305140.0002
Check MTime0.00123.9545140.0001
Mysql Total
Database connection0.00082.846810.0008
Mysqli_queries0.003010.371130.0010
Looping result0.00000.065510.0000
Template Total0.00124.210.0012
Template load0.00103.327410.0010
Template processing0.00020.844910.0002
Override
Cache load0.00072.421010.0007
General
dbfile0.00227.716780.0003
String conversion0.00000.040940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

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

Time used to render debug report: 0.0002 secs