HOW TO: Pimp the Joomla! login module
This article explains how to add some functionality to the standard Joomla! login module using an HTML override. The example below is taken from my website running on Joomla! 2.5.
Recently I changed the template of my website. Instead of getting one from a template club I decided to create a template from scratch using the Bootstrap Framework which is used by Joomla! 3.x. An excellent start for this new template gave me the Blank Template and Twitter Bootstrap Tutorial for Joomla! from Alexander Schmidt.
After the template was finished (so far) I found that the standard Joomla! login module looked a bit boring an could need some more functionality. The plan was to give my users access to often needed functions like "Private Messages" and the "Forum User Profile". I'm getting a lot of questions about how I created that "pimped" module so here is a howto.
Step 1: The HTML OverrideYes, it is possible to add functionality to Joomla! code without loosing the changes with the next Joomla! update. The answer is "HTML Override". The Joomla! documentation shows how that generally works: How to override the output from the Joomla! core
In our case we do NOT edit ./modules/mod_login/tmpl/default.php. Instead we create a copy of that file in the templates subdirectory. Go to TEMPLATE_NAME/html and create a directory "mod_login", then enter that directory and copy the above mentioned "default.php" to this new directory.
cp PATH_TO_JOOMLA/modules/mod_login/tmpl/default.php .
Step 2: Modify the login module html outputI wanted to have 3 links in the module, a link to the Joomla! profile settings (name, username, password,…), a link to the Discussions user profile (avatar, signature, …) and a link to the user's Private Messages. I opened the copy of default.php and added the links to my extensions. e.g.
You'll find the complete default.php in the zip-file:
Download modified default.php
Please note that this code is written for my website and only shows nice icons when used with Bootstrap. If you are not using Bootstrap, then you might want to add some icons the "traditional way" with img-tags. Anyway, the code should work and should give you a good start for your own User-Box.
Links:1. How to override the output from the Joomla! core
3. Blank Template and Twitter Bootstrap Tutorial for Joomla!
About the author
Showing 6 comments to "HOW TO: Pimp the Joomla! login module"
and extremely helpful and well explain. - See more at: