0

Redirect to url

I would like my users to be directed to a pop up login page or registration page instead of the regular page by default. I would like for this to happen when my user clicks the "ask now" or "continue" button but has not logged in.


Category: General Questions

Like it on Facebook, Tweet it or share this question on other bookmarking websites.

3

You can change it components/com_communityanswers/controllers/answers.php at line 213 (askQuestion function)
$link = JRoute::_("index.php?option=".$option."&view=answers".$this->getItemId());

For example, in Joomla 1.5 you can use the below code instead of above
$itemid=$this->getItemId();
$redirectUrl = base64_encode("index.php?option=".$option."&view=answers".$itemid);
$link = JRoute::_("index.php?option=com_user&view=login".$itemid."&return=".$redirectUrl);
Answered


138

I would like it to go to this url if they are not logged in http://www.makeoverfitness.com/fitness-community/profile.html and this url http://www.makeoverfitness.com/fitness-answers.html if they are logged in. Where would I insert those url's in that code exactly? Could you give me an example of how it would look with those url's inserted?

Thanks.
Answered


5

I really could not understand what you are saying.

When a user click Ask now button, he would be ideally taken to question form if he is authorized. Where as you are asking for him to go to some other page, how can he ask questions?
Answered


150

Yes I understand that. Since I have 2 different templates, the redirect goes to the questions form in the old template. I want it to redirect to the question form in the new template.

Also, if the user clicks the ask now button before they log in, I want them to be directed to a specific url instead of the page it currently sends them too. A lot of user may click the ask now button before logging in and I want to make sure I direct them to the pages I want them to go to.
Answered


0

How did you implemented the new template? If you have followed the template overrides (see docs) the override template will be automatically picked up, you need not do anything. For login redirection, my above code still stands.
Answered


Please register/login to answer this question.  Click here to login