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.