Login/Logout menu

December '13 Joomla Template
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Jul 19, 2016 4:01 pm
Reply with quote
Report this post
I made a menu item called logout. I want that to show only when a user is logged in.
have the login only show for public people and hide when people are logged in

and hide Signup when people are logged in
User avatar
Senior Boarder

teitbite
Sat Jul 23, 2016 4:09 pm
Reply with quote
Report this post
Hi

That's not as easy as it sounds. You can set Logout to "Registered" to make it but for login You will need to add an extra css class "only_not_registered" and add this code before ending </body> tag at /layout/default.php

Code: Select all
$user = JFactory::getUser();
$userID = $user->get('id');
if($userID!=0):
print '<style type="text/css">.only_not_registered { display: none; }</style>';
endif;
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.