PLEASE NOTE: This tutorial has now been superseded. There is no longer a need to use this method as there is now a template particle in most templates now called "popupmodule" that you can use to popup any module at all. Although this particle is not present in Callisto you can copy it from another template that does have it. If you want to know how to copy a Gantry 5 particle from one template to another please read my tutorial here in Gantry 5 Official Documentation
here
.
Creating a popup login form is quite easy to do in Gantry 5 and Callisto. There are other methods too that work just as well but I find this one the easiest.
1. Create a login module in module manager - there's no need to assign it to any position, just make a note of the ID of the module after you have create it.
This image is hidden for guests.
Please log in or register to see it.
2. In the callisto template > layout tab drag a "module instance" particle from the side of the screen onto the "copyright section" of the layout (down at the bottom).
This image is hidden for guests.
Please log in or register to see it.
3. Change the settings for the particle that you have added, on the particle tab add the module ID that you just made a note of.
This image is hidden for guests.
Please log in or register to see it.
4. On the block tab add a CSS ID of "mypoplogin" and a tag attribute "style" with value "display: none;". Save the particle.
This image is hidden for guests.
Please log in or register to see it.
5. Make sure that you have rokbox installed.
6. Now we need to create a link somewhere that opens the popup. To do that we'll use a "custom HTML" particle, so drag one of these from the side on the layout tab onto a suitable place on your layout.
This image is hidden for guests.
Please log in or register to see it.
7. In that particle add the following:<a href="#" data-rokbox data-rokbox-element="#mypoplogin"><span class="button button-2 button-red">Login</span></a>
Now save the particle.
This image is hidden for guests.
Please log in or register to see it.
8. Save the layout.
You should now have "login" button on the frontend of you site in whichever location you placed it. Clicking on the button will popup a login form.
This image is hidden for guests.
Please log in or register to see it.
The astute of you will have noticed that the button always says "Login" whether you are logged in or not. Don't worry we can soon improve that too (though we do need to use a little PHP too).
9. As you not allowed to enter PHP directly into custom HTML particle the first thing we need to do is download an install the FREE version of NoNumber Sourcerer
https://www.nonumber.nl/extensions/sourcerer#description
.
10. Now we can change all of the code in our custom HTML particle to this:{source}
<?php
$user = JFactory::getUser();
if ($user->guest) {
?>
[[a href="#" data-rokbox data-rokbox-element="#mypoplogin"]][[span class="button button-2 button-red"]]Login[[/span]][[/a]]
<?php
}
else {
?>
[[a href="#" data-rokbox data-rokbox-element="#mypoplogin"]][[span class="button button-2 button-red"]]Logout[[/span]][[/a]]
<?php
}
?>
{/source}
Now you'll find that the button says "Login" when you're not logged in and "Logout" when you are logged in.

Regards, Mark.
The following users have thanked you: Chuck C., Adi Heutschi, James Albury (aka Skip), Jami Dennis, Hugo Avila, C4, Henning, DanG, Josep M, Max Power COM_KUNENA_THANKYOU_MORE_USERS