Redirect to thank you page after using contact form
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
- snadowitz
- Joomla! Guru
- Posts: 764
- Joined: Wed Jan 18, 2006 4:40 am
- Contact:
Redirect to thank you page after using contact form
Guys,
how can I direct my users to a proper thank you page after they his the send button on a contact form? I know I saw it somewhere but despite searching I can't find it - driving me mad.................
how can I direct my users to a proper thank you page after they his the send button on a contact form? I know I saw it somewhere but despite searching I can't find it - driving me mad.................
Snadowitz
- ranwilli
- Joomla! Master
- Posts: 19203
- Joined: Sun Feb 19, 2006 6:47 pm
- Location: Toledo, OH
- Contact:
Re: Redirect to thank you page after using contact form
IMO, the easist way to do this is to use one of the forms extensions to make your own "Contact us" form... and you can then program the form to redirect after the form is submitted.
There are many good ones, I use Facile Forms and Phil-a-form.
There are many good ones, I use Facile Forms and Phil-a-form.
Don't HACK the Joomla! core, Instead "Extend" and/or "Override."
Stay ON the update path.
https://harpervance.com
Stay ON the update path.
https://harpervance.com
-
- Joomla! Explorer
- Posts: 256
- Joined: Thu Jul 05, 2007 10:41 am
Re: Redirect to thank you page after using contact form
Open Contact.php and go to line 473 - 475 and change the line:
$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:
--------------------------------------------------------------------------------
$link = sefRelToAbs( 'index.php?option=com_contact&task=view&contact_id='. $contact[0]->id .'&Itemid='. $Itemid );
mosRedirect( 'index.php?option=com_content&task=view&id=28&Itemid=102' );
Create thankyou page and menu item for ID, change this in the code to redirect to the item ID - remove menu item
$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:
--------------------------------------------------------------------------------
$link = sefRelToAbs( 'index.php?option=com_contact&task=view&contact_id='. $contact[0]->id .'&Itemid='. $Itemid );
mosRedirect( 'index.php?option=com_content&task=view&id=28&Itemid=102' );
Create thankyou page and menu item for ID, change this in the code to redirect to the item ID - remove menu item
Last edited by szonkie on Fri Aug 01, 2008 7:59 am, edited 2 times in total.
- snadowitz
- Joomla! Guru
- Posts: 764
- Joined: Wed Jan 18, 2006 4:40 am
- Contact:
Re: Redirect to thank you page after using contact form
thanks mate - I will try this over the weekend. Many thanks.
Snadowitz
-
- Joomla! Explorer
- Posts: 256
- Joined: Thu Jul 05, 2007 10:41 am
Re: Redirect to thank you page after using contact form
No probs give me a shout if stuck, I got mine working like this...
-
- Joomla! Apprentice
- Posts: 19
- Joined: Mon Sep 22, 2008 2:08 pm
Re: Redirect to thank you page after using contact form
I got it working by performing the following (used the directions above but had to modify to get it to work):
EDIT: This is on 1.5.7 install.
Open: com_contact >> controller.php
Find "$link" ( line 355 on mine )
108 = Article ID
125 = Menu Item ID
Thanks for the fix, worked immediately once I got the code right.
EDIT: This is on 1.5.7 install.
Open: com_contact >> controller.php
Find "$link" ( line 355 on mine )
Code: Select all
$link = JRoute::_('index.php?option=com_contact&view=contact&id='. $contact->slug .'&catid='.$contact->catslug, false);
$this->setRedirect('index.php?option=com_content&task=view&id=108&Itemid=125');
}
125 = Menu Item ID
Thanks for the fix, worked immediately once I got the code right.
[Erin...]
-
- Joomla! Enthusiast
- Posts: 235
- Joined: Mon Aug 22, 2005 8:56 pm
Re: Redirect to thank you page after using contact form
I'm just amazed that this isn't a default feature!
- snadowitz
- Joomla! Guru
- Posts: 764
- Joined: Wed Jan 18, 2006 4:40 am
- Contact:
Re: Redirect to thank you page after using contact form
me too - put it in as a request for future versions.
Snadowitz
-
- Joomla! Enthusiast
- Posts: 190
- Joined: Thu Jan 10, 2008 1:43 pm
Re: Redirect to thank you page after using contact form
I am not a programmer & having difficulty getting this to work. I never had trouble with it on previous versions of Joomla. What the heck is going on? Why wouldn't it redirect to a thank you page on the registration and contact forms?
I read several posts on what to change in the com_users/controller.php file. I tried replacing some code but it didn't work. Help, please!
I read several posts on what to change in the com_users/controller.php file. I tried replacing some code but it didn't work. Help, please!
- snadowitz
- Joomla! Guru
- Posts: 764
- Joined: Wed Jan 18, 2006 4:40 am
- Contact:
Re: Redirect to thank you page after using contact form
janeinpa wrote:I am not a programmer & having difficulty getting this to work. I never had trouble with it on previous versions of Joomla. What the heck is going on? Why wouldn't it redirect to a thank you page on the registration and contact forms?
I read several posts on what to change in the com_users/controller.php file. I tried replacing some code but it didn't work. Help, please!
Try pasting the section you edited from the controller.php file and see if someone can work out what is going wrong. What are the symptoms of the problem - exactly.
Snadowitz
-
- Joomla! Enthusiast
- Posts: 190
- Joined: Thu Jan 10, 2008 1:43 pm
Re: Redirect to thank you page after using contact form
It turned out to be a problem with the template itself. Luckily I was able to find the solution.
-
- Joomla! Apprentice
- Posts: 30
- Joined: Fri Sep 19, 2008 4:16 pm
- ncwebpros
- Joomla! Apprentice
- Posts: 29
- Joined: Tue Nov 18, 2008 4:27 pm
- Location: Indian Trail, NC
- Contact:
Re: Redirect to thank you page after using contact form
Thanks for that! Worked perfectly for me!rintuttle wrote:I got it working by performing the following (used the directions above but had to modify to get it to work):
EDIT: This is on 1.5.7 install.
Open: com_contact >> controller.php
Find "$link" ( line 355 on mine )
108 = Article IDCode: Select all
$link = JRoute::_('index.php?option=com_contact&view=contact&id='. $contact->slug .'&catid='.$contact->catslug, false); $this->setRedirect('index.php?option=com_content&task=view&id=108&Itemid=125'); }
125 = Menu Item ID
Thanks for the fix, worked immediately once I got the code right.
-
- Joomla! Intern
- Posts: 72
- Joined: Mon Sep 05, 2011 4:31 pm
Re: Redirect to thank you page after using contact form
hi i tried - not working - have 1.7 version
if ($contact->params->get('redirect')) {
$this->setRedirect($contact->params->get('redirect'), $msg);
} else {
$this->setRedirect(JRoute::_('index.php?option=com_contact&view=contact&id='.$stub, false), $msg);
last statement i replaced with below
$this->setRedirect(JRoute::_('index.php?option=com_content&view=article&id=18’, false), $msg);
}
and i get a syntax error in the line
$params = JComponentHelper::getParams('com_contact');
can anyone help?
if ($contact->params->get('redirect')) {
$this->setRedirect($contact->params->get('redirect'), $msg);
} else {
$this->setRedirect(JRoute::_('index.php?option=com_contact&view=contact&id='.$stub, false), $msg);
last statement i replaced with below
$this->setRedirect(JRoute::_('index.php?option=com_content&view=article&id=18’, false), $msg);
}
and i get a syntax error in the line
$params = JComponentHelper::getParams('com_contact');
can anyone help?
-
- Joomla! Intern
- Posts: 72
- Joined: Mon Sep 05, 2011 4:31 pm
Re: Redirect to thank you page after using contact form
have sorted out is working - was simple syntax mistake - now i have a thank you page but the header/title is "articles" - how do i get rid of that?
thanks
thanks
-
- I've been banned!
- Posts: 25
- Joined: Wed Aug 03, 2011 1:02 pm
Re: Redirect to thank you page after using contact form
thanks man its very good solutionszonkie wrote:Open Contact.php and go to line 473 - 475 and change the line:
$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:
--------------------------------------------------------------------------------
$link = sefRelToAbs( 'index.php?option=com_contact&task=view&contact_id='. $contact[0]->id .'&Itemid='. $Itemid );
mosRedirect( 'index.php?option=com_content&task=view&id=28&Itemid=102' );
Create thankyou page and menu item for ID, change this in the code to redirect to the item ID - remove menu item
-
- Joomla! Intern
- Posts: 72
- Joined: Mon Sep 05, 2011 4:31 pm
Re: Redirect to thank you page after using contact form
If any one is interested have managed to get rid of the header/title - "articles" -
1. Edit this file in your FTP Manager – Components/com_content/views/article/view_html.php
2. In this file earch and comment out below line.
// $this->params->def(‘page_heading’, JText::_(‘JGLOBAL_ARTICLES’));
1. Edit this file in your FTP Manager – Components/com_content/views/article/view_html.php
2. In this file earch and comment out below line.
// $this->params->def(‘page_heading’, JText::_(‘JGLOBAL_ARTICLES’));
-
- Joomla! Intern
- Posts: 70
- Joined: Mon Jul 14, 2008 6:50 pm
Re: Redirect to thank you page after using contact form
Hi,
I'm resurrecting this topic ... I'm with Joomla 2.5.9 and can't work out how to get the thank you page going. It might be that I don't know which contact.php and controller.php to edit. Checked the files under components/com_contact and the files under administrator/components/com_contact but the files there don't have the code lines mentioned in szonkie's and rintuttle's posts. Any suggestions?
I'm resurrecting this topic ... I'm with Joomla 2.5.9 and can't work out how to get the thank you page going. It might be that I don't know which contact.php and controller.php to edit. Checked the files under components/com_contact and the files under administrator/components/com_contact but the files there don't have the code lines mentioned in szonkie's and rintuttle's posts. Any suggestions?
-
- Joomla! Intern
- Posts: 72
- Joined: Mon Sep 05, 2011 4:31 pm
Re: Redirect to thank you page after using contact form
Hi
Am having the same problem with my 2.5 - as there is not even a thank you text, the page reloads with fields blank so u presume you have sent the form, which is correct - can you tell me which file to tweek please, to redirect to my thankyou article page
thankyou in advance
melanie
Am having the same problem with my 2.5 - as there is not even a thank you text, the page reloads with fields blank so u presume you have sent the form, which is correct - can you tell me which file to tweek please, to redirect to my thankyou article page
thankyou in advance
melanie