Forums / General / contact form on my ezpublish site

contact form on my ezpublish site

Author Message

Kevin Compton

Thursday 11 January 2007 3:36:34 pm

I'm not a developer, well not a code guy but I know a little, but I hired someone to make my site and I needed help figuring out how to change this one feature since hes unavailable at the moment.

The contact form he set up works, however for some reason in the "from" line of the e-mail of any submission from the contact form, no matter who it is or where its sent from, it always has my e-mail, as if I sent it.

Also I wanted to change the format of the output that gets sent, not the information but simply how the information is laid out on the e-mails it generates. The problem is there are spaces between each entry and it makes the print outs to long. So where would I likely edit this?

Thanks for all patience and any help.

Matthew Carroll

Thursday 11 January 2007 9:48:07 pm

You need to add a line to the template that processes sending the emails. Since ez has an extensible template override system and by your own admission you're not a "code guy" you may have a hard time finding the correct template to edit - you may even need to add a new override if the site is using the default at the moment. It may be in override/templates/collectedinfomail/feedback_form.tpl or similar. The line you need to add has to correspond to the field in the form that collects the sender's email address. In one live site of mine, the following works:

{set-block scope=global variable=email_sender}{$collection.attributes.2.data_text}{/set-block}

I hope that helps a little.
Matthew

http://carroll.org.uk

Kevin Compton

Friday 12 January 2007 9:42:06 am

It appears that the default override for that does not exist, so I will have to make one then?

And does that code you put reference to some other file I would also have to create? I'm trying to figure out how the actual format of the output gets deteremined.

Thanks!

Kevin Compton

Friday 02 March 2007 10:12:35 am

Okay I found the TPL that relates to my form, now I will clarify my issue.

The following link is my form:

http://www.cecvp.com/index.php?/plain/contact_us

Now heres my issue, the form is simply not done right I think. Instead of sending me this answer, like it should, for example on "I am interested in" (assuming someone chooses just two things):

I am intertested in: electronics, vibration transducers

Instead, my idiot programmer made it so that each item on the form, without exception, is a line with a colon. So it looks like 12 pages of this:

name:

catalog:

Vibration transducer:

etc

you get the idea. This form should print out in 1 page, 2 max. So my question is, how do I fix it? Any good tutorials? I don't want to change the form itself, just the manner in which it is formatted.

So heres the code:


{set-block scope=root variable=subject}{"Collected information from %1"|i18n("design/base",,array($collection.object.name|wash))}{/set-block}

{set-block scope=root variable=email_receiver}{$object.data_map.recipient.content}{/set-block}

{* Set this to redirect to another node
{set-block scope=root variable=redirect_to_node_id}2{/set-block}
*}

{"The following information was collected"|i18n("design/base")}:

{section name=Attribute loop=$node.data_map}



{if and(ne($Attribute:item.contentclass_attribute_name,'Recipient'),
ne($Attribute:item.contentclass_attribute_name,'Name'),
ne($Attribute:item.contentclass_attribute_name,'Description'))}

{if eq($Attribute:item.contentclass_attribute_name,'Vibration Transducers')}
	<br /><strong>I am interested in:</strong><br />
{/if}

{if eq($Attribute:item.contentclass_attribute_name,'Utility')}
	<br /><strong>Company Description Profile:</strong><br />
{/if}


{$Attribute:item.contentclass_attribute_name|wash}:
{attribute_result_gui view=info attribute=$:item}

{/if}
{/section}

Kevin Compton

Tuesday 06 March 2007 9:59:08 am

hello??

Claudia Kosny

Tuesday 06 March 2007 11:17:56 am

I think the problem is that the content of the attribute is not checked before it is printed so all attributes are printed no matter whether they are checked or not.

Without knowing the type of the attributes it is hard to say how to check whether something is selected or not. If the attribute is an checkbox you can try to change the almost last lines of your template like this:

{if $Attribute:item.content}
  {$Attribute:item.contentclass_attribute_name|wash}:
  {attribute_result_gui view=info attribute=$:item}
{/if}

This should check the content of the attribute and only display the next lines, if there is some content, meaning something is selected.

Please note that I have NOT tested this and it might not work. So if you have to try this on your live server please try sometime late at night and make a backup of the template beforehand...

You can also try to remove some linebreaks in the template and have a look whether this makes the email a bit more compact.

Claudia

PS: And please stop complaining about your 'idiot' programmer - sue him or do whatever else might make you happy but please leave the forum out of it.

Kevin Compton

Friday 09 March 2007 11:09:13 am

Claudia, thanks for the help but it didn't work. I'm still getting the same results. They are check boxes but all I get for them, rather I check them or not, is a blank space.

heres the actual form itself:

Here is I get to me everytime. (Ignore the filler text in the in the text fields). I also want to get rid of all those spaces in between, how do I do that?


The following information was collected:
Full Name:
testing the testicles

Subject:
hello

Message:
cha cha cha

Email:
kllkj@klkjlj.com

Title:


Department:


Company:


Address:
k;lk

City, State:
jl;kj;l

ZIP:
kjl;kljj

Country:
lklkj

Phone:
lkjlkj

Fax:


Preferred method of contact:


Send Catalog:


Vibration Transducers:


Accelerometers:


Monitoring Equipment:


Electronics:


Diagnostic Equipment:


Strain Gauge Bonding Services:


Utility:


Process Industries:


Aviation:


Engineering Firm:


Marine:


Government Agency/Military:


Research and Development:


Manufacturing Company:


Other:


(please indicate)::
&lt;Type Other Company Profile Here&gt;

Kevin Compton

Friday 09 March 2007 11:10:20 am

sorry forgot to link the form, here it is: http://www.cecvp.com/index.php?/plain/contact_us

Kevin Compton

Tuesday 13 March 2007 11:51:48 am

not all at once, everyone.

Jon Staines

Friday 16 March 2007 6:51:00 am

Try something like this in the feedback form template:

{set-block scope=root variable=subject}{"Collected information from %1"|i18n("design/base",,array($collection.object.name|wash))}{/set-block}
{set-block scope=root variable=email_receiver}{$object.data_map.recipient.content}{/set-block}
{set-block scope=global variable=email_sender}{$collection.attributes.3.data_text}{/set-block}
{* Set this to redirect to another node
{set-block scope=root variable=redirect_to_node_id}2{/set-block}
*}
{"The following information was collected"|i18n("design/standard/content/edit")}:

{section name=Attribute loop=$collection.attributes}
{if eq($Attribute:item.contentclass_attribute_name,'Vibration Transducers')}
<strong>I am interested in:</strong><br />
{/if}
{if eq($Attribute:item.contentclass_attribute_name,'Utility')}
<strong>Company Description Profile:</strong><br />
{/if}
{$Attribute:item.contentclass_attribute_name|wash}:
{attribute_result_gui view=info attribute=$Attribute:item}<br />
{/section}

Although you might need to change the number 3 in the set-block scope=global variable=email_sender line to whatever you have currently.

eZ debug

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

Main resources:

Total runtime1.1546 sec
Peak memory usage4,096.0000 KB
Database Queries219

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 587.7109180.8359
Module start 'content' 0.00840.9732 768.5469701.1641
Module end 'content' 0.98160.1729 1,469.7109345.0625
Script end 1.1545  1,814.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.3679210.0002
Check MTime0.00160.1385210.0001
Mysql Total
Database connection0.00070.062410.0007
Mysqli_queries1.069592.63182190.0049
Looping result0.00220.18932170.0000
Template Total1.121397.120.5607
Template load0.00220.187320.0011
Template processing1.119196.928720.5596
Template load and register function0.00010.010010.0001
states
state_id_array0.00100.083010.0010
state_identifier_array0.00080.070520.0004
Override
Cache load0.00190.1688560.0000
Sytem overhead
Fetch class attribute can translate value0.00140.118050.0003
Fetch class attribute name0.00110.0971120.0001
XML
Image XML parsing0.00150.128650.0003
class_abstraction
Instantiating content class attribute0.00000.0020120.0000
General
dbfile0.00480.4121330.0001
String conversion0.00000.000630.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
10content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 33
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs