Support Forums

adding drop down subject line in contactus.tpl

This is a discussion on adding drop down subject line in contactus.tpl within the Templates, HTML, CSS, and Design Help forums, part of the General category; Hi all, If possible I would like to add an additional dropdown field in my contactus.tpl page <tr> <td class="formleft">Subject{$smarty.const.LANG_COLON} ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 02-07-2010, 02:48 AM   #1
Customer
 
jason1971's Avatar
 
Join Date: Jan 2009
Location: England
Posts: 147
Rep Power: 13
jason1971 is on a distinguished road
Default adding drop down subject line in contactus.tpl

Hi all,

If possible I would like to add an additional dropdown field in my contactus.tpl page

<tr>
<td class="formleft">Subject{$smarty.const.LANG_COLON} </td>
<td class="formright"> <select>
<option>General</option>
<option>Advertising</option>
<option>Website Isuue / Problem</option>
<option>Other</option>
</select></td>
</tr>

I am aware it is not as straight forward as just adding it to contactus.tp, but I would be grateful for any info on how to acheive this.

Many thanks

Jason.
__________________
v4.1.8 Hosted - using Templatecodes neo2- green template
jason1971 is offline   Reply With Quote
Old 02-07-2010, 08:16 AM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

I dont have the specifics of what needs to be changed where but the underlying php file that is the target of the submitted form data is going to recieve data from the form and it wont know how to handle it unless you tell it what to do with it. You will have to alter the php code and append/prepend the $subject or $message mail variable with the dropdown contents so that it gets sent along with the mail.

Looking at the template should whow you the name of the php file the info gets posted to.

EDIT. Looks like are running the hosted version so likely wont be able to edit the php file.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 02-07-2010, 10:08 AM   #3
Customer
 
jason1971's Avatar
 
Join Date: Jan 2009
Location: England
Posts: 147
Rep Power: 13
jason1971 is on a distinguished road
Default

so to sum up larry is that going to be a big fat No in terms of me being able to do it, because im running the hosted version ? I sort of thought that might be the case.
__________________
v4.1.8 Hosted - using Templatecodes neo2- green template
jason1971 is offline   Reply With Quote
Old 02-07-2010, 10:55 AM   #4
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by jason1971
so to sum up larry is that going to be a big fat No in terms of me being able to do it, because im running the hosted version ? I sort of thought that might be the case.
You MAY be able to do something at the template level.

The php script is looking for a specific variable, which you cant alter but what you may be able to do at the template level is rename the existing subject field name, create your dropdown with its name and then assign your newly named subject var and your dropdown var to the original subject var so the php script gets what its expecting.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 02-08-2010, 01:09 AM   #5
Customer
 
jason1971's Avatar
 
Join Date: Jan 2009
Location: England
Posts: 147
Rep Power: 13
jason1971 is on a distinguished road
Default

I have tried using the {$friendname} to assign to my contact form like this

<tr>
<td class="formleft">{$smarty.const.LANG_FRIEND_NAME}{ $smarty.const.LANG_COLON}</td>
<td class="formright"><input name="friendname" type="text" size="{$smarty.const.FIELD_SIZE}" value="{$friendname}" />
</td>
</tr>

as a test what ever I type in the text are does not come through in the email, I have added the {$friendname} in the emails/html/contactus.tpl file but still nothing.

Am I missing something or doing it totally wrong (as usual)

I think my hair is going to start falling out with this problem , any thoughts anybody ?



Thanks

jason
__________________
v4.1.8 Hosted - using Templatecodes neo2- green template
jason1971 is offline   Reply With Quote
Old 02-08-2010, 04:27 AM   #6
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,342
Rep Power: 84
seymourjames is a jewel in the rough
Default

Try this

<input name="XXXX" type="text" size="{$smarty.const.FIELD_SIZE}" value="{$friendname}" />

where XXX is the name it is expecting.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 02-08-2010, 09:14 AM   #7
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by seymourjames
Try this

<input name="XXXX" type="text" size="{$smarty.const.FIELD_SIZE}" value="{$friendname}" />

where XXX is the name it is expecting.
The problem, as I stated above is that the underlying script doesnt know about the field friendname and therefor will NEVER use its contents.

You need to give the subject a new name then create a new variable with the old subject name and assign it the values of the new subject + friendname.

Something along these lines im guessing, but have not tried it...


{assign var=subject value=value=`$oldsubject` - `$friendname`}
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 02-08-2010, 10:05 AM   #8
Customer
 
jason1971's Avatar
 
Join Date: Jan 2009
Location: England
Posts: 147
Rep Power: 13
jason1971 is on a distinguished road
Default

Thanks larry

Sorry to sound thick about this, but there do I put this and what do I need to do with it

{assign var=subject value=value=`$oldsubject` - `$friendname`}


also as $friendname is used in the form to send info about a listing to a friend will it mess that up ? I only used $friendname as I thought it might work


Many thanks Larry

\jason
__________________
v4.1.8 Hosted - using Templatecodes neo2- green template
jason1971 is offline   Reply With Quote
Old 02-09-2010, 08:37 AM   #9
Customer
 
jason1971's Avatar
 
Join Date: Jan 2009
Location: England
Posts: 147
Rep Power: 13
jason1971 is on a distinguished road
Default

anybody any ideas please ?

Thanks

Jason
__________________
v4.1.8 Hosted - using Templatecodes neo2- green template
jason1971 is offline   Reply With Quote
Old 02-09-2010, 04:44 PM   #10
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I'm a little confused in reading through this thread as you started this out as wanting an additional drop down field in the "contactus.tpl", however in following posts you refer to $friendname which is not even a variable in the contactus.tpl. That is from a completely different file.

As already stated previously, you can't just add a variable as the template is processed by the contactus.php file and without the developers version (access to modify code in that file) you can not just add the variable for processing.

What would be possible is to make a module for it as there is an existing modulehook in the contactus.php file.
PHP Code:
$modules->call_hook('contact_us_submit'''); 
Therefore, you could essentially use that hook to capture (template variable) and declare the variable and continue to send it on to the other processing php files.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
friendmail - subject shown as ? haxxy Technical Support 3 11-23-2009 09:14 AM
Line breaks stripped from multi-line text extra field HotAir Technical Support 4 11-17-2008 12:07 PM
email subject anna245 Technical Support 2 06-11-2008 07:12 AM
contactus.tpl cranko Technical Support 3 05-07-2008 06:16 AM


All times are GMT -4. The time now is 07:06 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0