Home Pricing Glossary Sitemap Contact Support Login Search
Home arrow Site Map arrow Index arrow CMS arrow Bug Fixes 
ALL |0-9 |A |B |C |D |E |F |G |H |I |J |K |L |M |N |O |P |Q |R |S |T |U |V |W |X |Y |Z

Index arrow CMS arrow Bug Fixes

Creat Redirect after submit contact form Joomla Print E-mail

How to get rid of the annoying "Thank  you" message users see after submiting information in the Joomla contact form. This trick supplied by Leo of Joomla sums it up perfectly. It even shows and lets you create a custom thank you form instead of redirecting to the index page. It only takes about 5 minutes to implement also!

  • Make a Thank-You page in Static Content. Choose whatever content or title you want to use.

  • Create a link from the main menu  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. Show the link as published, but you can unpublish it later, the Thank you page will still show even if the link to it on the main menu is deleted or unpublished.

  • 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 Dreamweaver or equivalent the contact.php file, located in components/com_contact

now find on or around line 450 - 452 (in v1.0.10) this code:
$link = sefRelToAbs( '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
Quote

'       '

at the beginning and the end. Do not forget those! Don't forget the

;

 either at the end

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...


 
Web Site Design Services Canada - SEO Vancouver BC Webmaster
Copyright © 1999-2008 | 6805 Fleming Street Vancouver, British Columbia, Canada V5P 3H4
Toll Free Phone: 1-800-680-1358 - Toll Free Fax: 1-801-740-8940 Privacy | Contact | Archive