Forums / Templates, Stylesheets, Page Layout / How to add fields in the contact us page?

How to add fields in the contact us page?

Locked

Started by rainmist on 9 Dec 2008, 4:48 AM · Views: 1,059

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
9 Dec 2008, 4:48 AM
#1
rainmist avatar

rainmist

New Zenner

Join Date:
Jun 2007
Posts:
71
Plugin Contributions:
0

How to add fields in the contact us page?

The default fields in contact us page are full name, address and message. How to add more fields in the contact us page?

LED flood Lights - Energy saving! Eco-friendly! Long lifespan.
Bollard Lights - Excelllent design.

13 Dec 2008, 7:01 AM
#2
shocker avatar

shocker

Zen Follower

Join Date:
Jul 2007
Location:
Jakarta
Posts:
346
Plugin Contributions:
0

Re: How to add fields in the contact us page?

You will need to make changes using the override system.

The file that you will need to modify is

includes/template/YOUR_TEMPLATE/templates/tpl_contact_us_default.php

13 Dec 2008, 7:06 AM
#3
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: How to add fields in the contact us page?

shocker:

You will need to make changes using the override system.

The file that you will need to modify is

includes/template/YOUR_TEMPLATE/templates/tpl_contact_us_default.php
not enough, need to add more codes in includes/modules/pages/contact_us/header_php.php to handle new fields as well.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

13 Dec 2008, 11:36 AM
#4
shocker avatar

shocker

Zen Follower

Join Date:
Jul 2007
Location:
Jakarta
Posts:
346
Plugin Contributions:
0

Re: How to add fields in the contact us page?

Thanks yellow1912

How do you get the new fields added the the email that's sent. It got it to display.

As a test I tried the following code:

includes/modules/pages/contact_us/header_php.php

    $html_msg['NEW_FIELD1'] = strip_tags($_POST['new_field1']);

includes/template/YOUR_TEMPLATE/templates/tpl_contact_us_default.php

<label class="inputLabel" for="new-field1"><?php echo ENTRY_NEW_FIELD1; ?></label>
<?php echo zen_draw_input_field('new-field1', ($error ? $_POST['new-field1'] : $email), ' size="40" id="new-field1"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />