Jump to content

Contact Form Submitted Thank You Page


Ht872

Recommended Posts

Is there a way to display a CMS thank you page after the user submits the contact-form?

 

At the moment the user is presented with a fairly basic message that reads "Your message has been successfully sent to our team" in contact-form.tpl in the default-bootstrap theme.  It would be good so that instead of this the user is taken to a separate CMS page that can be used to track properly on Google Analytics.

 

Thanks.

Link to comment
Share on other sites

It is in contact-form.tpl in your theme. You can adapt that file.

 

Thanks.  I have been looking in there but not sure the best way to do this.  Ideally I'd like the contact form to simply forward to a CMS page.  If you'd be able to explain how to do this it would be a huge help as I don't have much experience when it comes to editing .tpl files.

 

Thanks again.

Link to comment
Share on other sites

In Contact-form.tpl you will find something like 

{if isset($confirmation)}
	<p class="alert alert-success">{l s='Your message has been successfully sent to our team.'}</p>
	<ul class="footer_links clearfix">
		<li>
			<a class="btn btn-default button button-small" href="{$base_dir}">
				<span>
					<i class="icon-chevron-left"></i>{l s='Home'}
				</span>
			</a>
		</li>
	</ul>
{elseif isset($alreadySent)}

You should replace that with something like

{if isset($confirmation)}
<script>location.href="http://www.myshop.com/mybeautifulcmspage";</script>
{elseif isset($alreadySent)}

It is not really an elegant solution but it should work.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

On further though it might be better to use the following code:

{if isset($confirmation)}
        <script>location.href="http://www.myshop.com/mybeautifulcmspage";</script>
	<p class="alert alert-success">{l s='Your message has been successfully sent to our team.'}</p>
	<ul class="footer_links clearfix">
		<li>
			<a class="btn btn-default button button-small" href="{$base_dir}">
				<span>
					<i class="icon-chevron-left"></i>{l s='Home'}
				</span>
			</a>
		</li>
	</ul>
{elseif isset($alreadySent)

I will still bring you to the new page. But when for some reason Javascript doesn't work on your page it will display the traditional message.

  • Like 1
Link to comment
Share on other sites

  • 4 years later...

First search in:

\themes\active_theme\modules\contactform\views\templates\widget\contactform.tpl

If you do not find the file in the theme, directly in the module:

\modules\contactform\views\templates\widget\contactform.tpl

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...