show login form in the popup or lightbox
- Webdongle
- Joomla! Master
- Posts: 44093
- Joined: Sat Apr 05, 2008 9:58 pm
Re: show login form in the popup or lightbox
Yes, Create it in an Article view code <> Then paste into the url of the menu item.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
- gilles007
- Joomla! Enthusiast
- Posts: 237
- Joined: Fri Jun 15, 2007 4:58 pm
Re: show login form in the popup or lightbox
hey guys, still trying to use the "modal" version of the solution. Still no go.
Do I put the php line in my template's index.php?
PS. the class="modal" syntax generates an error, so it's still unclear as to the correct syntax for the url to make the login component modal.
any ideas?
G
Do I put the php line in my template's index.php?
PS. the class="modal" syntax generates an error, so it's still unclear as to the correct syntax for the url to make the login component modal.
any ideas?
G
- quazi_ahasan
- Joomla! Apprentice
- Posts: 43
- Joined: Fri Mar 11, 2011 2:48 pm
Re: show login form in the popup or lightbox
hi, I tried and followed your way but how can I control the forms hight & width, I appreciate your help.... :)
gilles007 wrote:Hi Webdongle,
I put this in as an external URL link:
I hope that makes sense.Code: Select all
http://www.mysite.com/index.php?option=com_user&view=login&tmpl=component" rel="width[400];height[500];" class="jcepopup
G
- gilles007
- Joomla! Enthusiast
- Posts: 237
- Joined: Fri Jun 15, 2007 4:58 pm
Re: show login form in the popup or lightbox
did you try using the width/height as shown in the example?
by the way, I trashed this whole idea as it wasn't working properly for me and ended up using YOOlogin in a module position instead.
G
by the way, I trashed this whole idea as it wasn't working properly for me and ended up using YOOlogin in a module position instead.
G
- quazi_ahasan
- Joomla! Apprentice
- Posts: 43
- Joined: Fri Mar 11, 2011 2:48 pm
Re: show login form in the popup or lightbox
Hi G, thanks for replying and for me to it seems not a good idea. because it does not pop-up, opens a new window, which can be done by any menuitem. what about your new idea, is it working well?
By the way I tryed the Hight and width measurement. Didn't worked.
By the way I tryed the Hight and width measurement. Didn't worked.
- gilles007
- Joomla! Enthusiast
- Posts: 237
- Joined: Fri Jun 15, 2007 4:58 pm
Re: show login form in the popup or lightbox
yes quazi,
the yootools solution worked perfectly. I used the slim setting of the extension and positioned it near the bottom of the site. This way it's unobtrusive. Not a popup but does the job.
give it a try.
G
the yootools solution worked perfectly. I used the slim setting of the extension and positioned it near the bottom of the site. This way it's unobtrusive. Not a popup but does the job.
give it a try.
G
-
- Joomla! Apprentice
- Posts: 20
- Joined: Tue Apr 21, 2009 10:33 pm
Re: show login form in the popup or lightbox
Thanks Milad. This works almost flawlessly, much appreciated. I have one question. I placed the above code in the Footer of my site and it pops up the modal window as expected and I can login.MeeDNite wrote:Hi,
Use This:Code: Select all
<?php JHTML::_('behavior.modal'); ?> <a class="modal" href="index.php?option=com_user&view=login&tmpl=component">login</a>
Do you or anyone else know how to code this so that when I successfully login, I have write code to dynamically change the "Login" text to "Logout" so that if I click on Logout it calls that function.
Right now, with the code you've given, I have only two ways of logging out. 1>Session expires or, 2>I have to place the login module somewhere, which is what we don't want. Defeats the purpose of what were trying to do.
I've been researching this and trying many things but I'm not knowledgeable in PHP. Any help is appreciated. Been researching MVC Framework and php coding but there's tons to learn. ;p
Not knowing what I'm doing I thought something like this, but I'm clueless. It's the idea that counts right now. I think maybe the book I have uses oldstyle Joomla coding techniques as well. Any ideas anyone?? The below code doesn't work but it's what looks like should work. Heh..
Code: Select all
<?php JHTML::_('behavior.modal'); ?>
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">
<?php
if ($user->guest) {
echo '<a href="index.php?option=com_user&view=login&tmpl=component">Login</a>';
} else {
$name = $user->get('username');
echo "Logged in as " . $name . ", ";
echo '<a href="index.php?option=com_user&view=login&tmpl=component">';
echo ' Logout';
echo '</a>';
}
?>
</a>
Code: Select all
<?php JHTML::_('behavior.modal'); ?>
<a class="modal" style="color:#FFFFFF;" href="index.php?option=com_user&view=login&tmpl=component">
<?php echo ($user->guest) ? "Login" : "Logout" ?>
</a>
Thanks,
Bigsky
- verticalgrain
- Joomla! Enthusiast
- Posts: 105
- Joined: Mon Dec 01, 2008 4:16 am
- Contact:
Re: show login form in the popup or lightbox
I think this module (YJ Pop Login) would serve for this purpose as well and is very easy to use since you just have to install and enable it:
http://extensions.joomla.org/extensions ... ation/8646
http://extensions.joomla.org/extensions ... ation/8646
- kurchania
- Joomla! Hero
- Posts: 2070
- Joined: Mon Sep 21, 2009 6:56 am
- Location: indore,india
- Contact:
Re: show login form in the popup or lightbox
@verticalgrain
YJ popup login is good but it conflict with jquery of you have any plugin
YJ popup login is good but it conflict with jquery of you have any plugin
abhijeet kurchania
The future depends on what you do today
The future depends on what you do today
-
- Joomla! Apprentice
- Posts: 20
- Joined: Tue Apr 21, 2009 10:33 pm
Re: show login form in the popup or lightbox
@verticalgrain
I appreciate your input and helpful hints. What I dislike doing with Joomla is consistently installing 3rd party plugins to solve problems that appear to be solvable through existing native/built-in code. Basically the less 3 party plugins the better IMO.
I've got the code working above but don't have the PHP know how to get it working correctly. Surely I'm missing something very simple that I don't understand with the php coding or javascript/jquery.
I hope someone can point out how to adust my code above to simply change the link title from login to logout once someone logs in. I'm thinking maybe this might be something I can do with jquery or javascript, but I'm new to those technologies as well. Oh well. I'll get it figured out and post back my findings if I ever get the time to do more research on the issue. I can't be the only one that could benefit from achieving this functionality via native methods without having to resort to yet another 3rd party plugin.
I appreciate your input and helpful hints. What I dislike doing with Joomla is consistently installing 3rd party plugins to solve problems that appear to be solvable through existing native/built-in code. Basically the less 3 party plugins the better IMO.
I've got the code working above but don't have the PHP know how to get it working correctly. Surely I'm missing something very simple that I don't understand with the php coding or javascript/jquery.
I hope someone can point out how to adust my code above to simply change the link title from login to logout once someone logs in. I'm thinking maybe this might be something I can do with jquery or javascript, but I'm new to those technologies as well. Oh well. I'll get it figured out and post back my findings if I ever get the time to do more research on the issue. I can't be the only one that could benefit from achieving this functionality via native methods without having to resort to yet another 3rd party plugin.
-
- Joomla! Apprentice
- Posts: 20
- Joined: Tue Apr 21, 2009 10:33 pm
Re: show login form in the popup or lightbox
Here's the fix thanks to some friendly help from one of the PHP guru's on the Rochen Forums where I host.
Works for me. Hope that helps others. No need for a 3rd party plugin.
Code: Select all
<p class="loginbox" style="color:#FFFFFF;text-align:center;">
<?php JHTML::_('behavior.modal');
$user =& JFactory::getUser();
?>
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">
<?php
if ($user->guest) {
echo '<a class="modal" style="color:#FFFFFF;"
href="index.php?option=com_user&view=login&tmpl=component">Login</a>';
} else {
echo '<a class="modal" style="color:#FFFFFF;" href="index.php?option=com_user&view=login&tmpl=component">';
echo 'Logout';
echo '</a>';
}
?>
</a>
</p>
- gilles007
- Joomla! Enthusiast
- Posts: 237
- Joined: Fri Jun 15, 2007 4:58 pm
Re: show login form in the popup or lightbox
Thanks for posting/sharing your solution bigsky.
-
- Joomla! Apprentice
- Posts: 20
- Joined: Tue Apr 21, 2009 10:33 pm
Re: show login form in the popup or lightbox
No problem gilles007. Hope someone can put it to use.
Bigsky
Bigsky
- kurchania
- Joomla! Hero
- Posts: 2070
- Joined: Mon Sep 21, 2009 6:56 am
- Location: indore,india
- Contact:
Re: show login form in the popup or lightbox
@bigsky
thanx for your solution much appreciated
but i guess i already mention this thing before
thanx for your solution much appreciated
but i guess i already mention this thing before
abhijeet kurchania
The future depends on what you do today
The future depends on what you do today
-
- Joomla! Apprentice
- Posts: 20
- Joined: Tue Apr 21, 2009 10:33 pm
Re: show login form in the popup or lightbox
Hi Kurchania,kurchania wrote:@bigsky
thanx for your solution much appreciated
but i guess i already mention this thing before
I understand you offered some help and I'm thankful for that. As well as all the others that spent the time to comment in this thread. That got me started looking in the right direction. And that helped. But it was only half the solution for me.
I don't want to rely on 3 party plugins/modules when we can use the built-in native login code to achieve the same goal. Everywhere I looked for solutions, everyone was given the same answer. Poping open a modal window is half the solution IMO, and using 3rd party solutions to solve this task is silly. That's just my opinion and maybe the original thread opener was satisfied with a half baked solution that is stuffed with unneeded code from some 3rd party.
What My Code Offers and what I was trying to accomplish:
- Use Joomla native login code with as few lines of code as possible.
- Calling the Joomla login component via an anchor link, called "Login",(can be any anchor link you want) in the footer of the site that will open in a modal window.
- Once the user authenticates, the "Login" link dynamically changes to say "Logout".
- Once the user logs out, the anchor link dynamically changes back to say "Login".
- We want a way for junior admins to login without dedicating a whole article/page just to login/logout.
- Calling the login component via a modal window gives us the functionality above.
- Placing the code in the footer of the templates index.php file, allows access to the login function, regardless of which page you are on.
- Being that it pop's up in a modal window saves on screen real-estate.
- Dynamically changing the link text from Login to Logout, when logged in. And from Logout to Login after logging out is a friendly and responsible way to remind our junior admins at a glance if they are still logged in or not. (For my task, once logged in, I was told to make the "Logout" Font Size 24px in red to help them remember to logout. Their company policy, not mine.
- No need to spend ANY time worrying about updating/patching YET another 3rd party Extension. If time is money for you, then guess what? Your saving yourself some money. :P
The most important part of the code that was missing for me was the need to refresh the USER OBJECT. IE..
$user =& JFactory::getUser();
Without the code above, my anchor links wouldn't dynamically change state as needed.
Code: Select all
<p class="loginbox" style="color:#FFFFFF;text-align:center;">
<?php JHTML::_('behavior.modal');
$user =& JFactory::getUser(); // Gets and refreshes user object
?>
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">
<?php
if ($user->guest) {
echo '<a class="modal" style="color:#FFFFFF;"
href="index.php?option=com_user&view=login&tmpl=component">Login</a>';
} else {
echo '<a class="modal" style="color:#FFFFFF;" href="index.php?option=com_user&view=login&tmpl=component">';
echo 'Logout';
echo '</a>';
}
?>
</a>
</p>
Thanks Everyone,
Bigsky
- kurchania
- Joomla! Hero
- Posts: 2070
- Joined: Mon Sep 21, 2009 6:56 am
- Location: indore,india
- Contact:
Re: show login form in the popup or lightbox
@bigsky
thanx for your explanation
thanx for your explanation
abhijeet kurchania
The future depends on what you do today
The future depends on what you do today
-
- Joomla! Apprentice
- Posts: 6
- Joined: Fri Aug 19, 2011 10:16 am
Re: show login form in the popup or lightbox
<?php JHTML::_('behavior.modal'); ?>
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">login</a>
This code in not working on my local server. Instead of opening in popup, it is opening like <a href=""> without any effect.
Please help.
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">login</a>
This code in not working on my local server. Instead of opening in popup, it is opening like <a href=""> without any effect.
Please help.
-
- Joomla! Apprentice
- Posts: 20
- Joined: Tue Apr 21, 2009 10:33 pm
Re: show login form in the popup or lightbox
Hi djoshi,djoshi wrote:<?php JHTML::_('behavior.modal'); ?>
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">login</a>
This code in not working on my local server. Instead of opening in popup, it is opening like <a href=""> without any effect.
Please help.
On my localhost WAMP setup, I cut and pasted your code into the footer div of my templates index.php file and it opens in a modal window like it's supposed to. Not sure why this isn't working for you.
I'm using Joomla 1.5.x. I don't know how this code works in Joomla 1.6 or .7
You didn't specify where you were placing your code. Via an Article or via index.php file. If your placing this code via article manager then some code could be getting stripped by your editor or possibly your template makers code if your using a 3rd party template coded by someone else.
To be honest I really don't know WHY this isn't working for you. I'm just trying to help you get more specific so you can get some better help from someone else.
Good luck. You might even try opening your own thread at the same time. Get double exposure and possibly double the help in this thread and the new one.
-
- Joomla! Fledgling
- Posts: 4
- Joined: Wed Apr 08, 2009 3:28 pm
Re: show login form in the popup or lightbox
...Hi guys...I have inserted this code in a module position ( <!--?php JHTML::_('behavior.modal'); ?--> <a class="modal" href="login">LOGIN</a> ) ...It's working but when you login, the page load in the light box itself...That's not good at all...
...The light box need's to close and then load the redirect page...How can I do that...?
...Thanks for the help...!
Ben
...The light box need's to close and then load the redirect page...How can I do that...?
...Thanks for the help...!
Ben
-
- Joomla! Fledgling
- Posts: 1
- Joined: Tue Feb 21, 2012 9:51 am
Re: show login form in the popup or lightbox
Hello, everyone. I just saw this post and like the login form.
But when I used it, I get a "An error has occurred" message.
Please help....
Thanks
But when I used it, I get a "An error has occurred" message.
Please help....
Thanks
-
- Joomla! Intern
- Posts: 56
- Joined: Wed Feb 16, 2011 12:36 am
Re: show login form in the popup or lightbox
Is possible to use this code in mod_hellome for Jomsocial login and how? I really need thisbigsky wrote:Here's the fix thanks to some friendly help from one of the PHP guru's on the Rochen Forums where I host.
Works for me. Hope that helps others. No need for a 3rd party plugin.Code: Select all
<p class="loginbox" style="color:#FFFFFF;text-align:center;"> <?php JHTML::_('behavior.modal'); $user =& JFactory::getUser(); ?> <a class="modal" href="index.php?option=com_user&view=login&tmpl=component"> <?php if ($user->guest) { echo '<a class="modal" style="color:#FFFFFF;" href="index.php?option=com_user&view=login&tmpl=component">Login</a>'; } else { echo '<a class="modal" style="color:#FFFFFF;" href="index.php?option=com_user&view=login&tmpl=component">'; echo 'Logout'; echo '</a>'; } ?> </a> </p>
Please read the Forum rules regarding signatures: http://forum.joomla.org/viewtopic.php?t=65
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Sep 04, 2012 5:00 pm
Re: show login form in the popup or lightbox
Hello, i have a problem.
-------
<?php JHTML::_('behavior.modal'); ?>
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">login</a>
-------
Why does when a user type key "X" the popup close ?
i have joomla 1.5. Thanks for any help.
-------
<?php JHTML::_('behavior.modal'); ?>
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">login</a>
-------
Why does when a user type key "X" the popup close ?
i have joomla 1.5. Thanks for any help.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Sep 04, 2012 5:00 pm
Re: show login form in the popup or lightbox
No one ?
schweiner wrote:Hello, i have a problem.
-------
<?php JHTML::_('behavior.modal'); ?>
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">login</a>
-------
Why does when a user type key "X" the popup close ?
i have joomla 1.5. Thanks for any help.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Sep 04, 2012 5:00 pm
Re: show login form in the popup or lightbox
Ok. look: media/system/js/modal.js and delete - case 'x': - bye.
schweiner wrote:No one ?
schweiner wrote:Hello, i have a problem.
-------
<?php JHTML::_('behavior.modal'); ?>
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">login</a>
-------
Why does when a user type key "X" the popup close ?
i have joomla 1.5. Thanks for any help.