|
How to REDIRECT after Submit Contact-form! |
Many questions have been asked on how to redirect to a Thank-You page after submitting a contact-us form from the contact component. The current implementation of the Thank you message above the submitted form is a jerk and not very profesional.
Here is a way how to solve this, compliments of Joomadesk!
- Make a Thank-You page in Static Content. Choose whatever content or title you want to use.
- Create a menu-item (Static-Content) and point it to your Thank-You page or whatever title you have given it. The reason for this is that we want to findout the exact URL of the link to your static content "thank-you" page
- Imagine that your link has got the id's something like http://www.yoursite.com/index.php?option=com_content&task=view&id=15&Itemid=44. This means we now know what the URL is so we can modify some little piece of code...It is only very little!
- Open with a good editor such as JEdit or Dreamweaver or equivalent the contact.php file, located in components/com_contact
now find on or around line 462 - 464 (in the example version) this code:
$link = 'index.php?option=com_contact&task=view&contact_id='. $contact[0]->id .'&Itemid='. $Itemid; mosRedirect( $link, _THANK_MESSAGE )
replace that code with the URL for the contact Thank-you page as defined as follows:
mosRedirect( 'http://www.yoursite.com/index.php?option=com_content&task=view&id=15&Itemid=44' )
Indeed you see it correct...the first line has been deleted and if you look sharp (you have to!) you also see ' ' at the beginning and the end. Do not forget those!
If you have SEF enabled and have some nice URL's defined or have something like (example) http://www.yoursite.com/content/view/15/44/ than put that SEF-based URL into the code...
Works like a charm!
|