News2 Template Login Link Redirections

Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Tue Apr 21, 2015 10:39 am
Reply with quote
Report this post
Hi,
I'm using the link "index.php/component/users/?view=login&tmpl=blankpage" in the News2 Template > Features>Login URL. How do I control the redirection page after login? Right now, after login, it just goes to "/component/users/?view=login" which only shows a 'Logout button' in the page content area.

Also, once logged in, the template login link reads "my account", which does not actually go to the profile page (as the name suggests) but it goes to the same user component page "/component/users/?view=login". Can the "My Account" URL also be controlled somehow to actually go to the user profile page?

I have tried using a hidden menu, with a menu item of type 'Users Manager » Login Form' which has the login & Logout URL redirection controls, but if I use this URL, I cannot use the style of 'index.php/component/users/?view=login&tmpl=blankpage'. If my hidden menu item alias is /login, I have tried setting 'index.php/login&tmpl=blankpage' as the Login URL in the template settings... but this gives a 404.
How do I retain the template style for the login page, as well as control login, logout URLs & the link to 'My Account' which ideally should be the profile page.
User avatar
Fresh Boarder

teitbite
Sat Apr 25, 2015 8:49 am
Reply with quote
Report this post
Hi

index.php/component/users/?view=login&tmpl=blankpage is just a component, so You should be able to make a menu item (in a hidden menu if You like) to a login and set redirection there.

Edit /layout/default.php and in a line:

Code: Select all
<a href="<?php echo str_replace('&', '&amp;', ($userID == 0) ? $this->API->get('login_url', 'index.php?option=com_users&view=login') : str_replace('&tmpl=blankpage', '', $this->API->get('login_url', 'index.php?option=com_users&view=login'))); ?>" id="gkLogin"><?php echo ($userID == 0) ? JText::_('TPL_GK_LANG_LOGIN') : JText::_('TPL_GK_LANG_LOGOUT'); ?></a>


change part

Code: Select all
str_replace('&tmpl=blankpage', '', $this->API->get('login_url', 'index.php?option=com_users&view=login'))


to link.
User avatar
Moderator


cron