Joomla log out button

Be Warned Mild Tech speak ahead!!

 

Joomla is a great system.  It’s simple to have a registered area and a visitor area.  Your registered users can then have access to all types of information.  However I came across a bit of a problem the other day.  I wanted to put a button onto the site that allowed users to log out.  Seems such a simple thing to do.  Unfortunately it’s not!

 

Joomla provides a way to get the button onto the top menu but not a way that allows you to put it where you want.  For example you might want it in an article but you can’t do that.  Alternatively you might want it in a module with other buttons.  Again you can’t do it – well not easily.  I searched and searched for someone who’d written one and was really surprised that no one had.  I was doubly surprised at how difficult it was to find out how to produce the button.  So I decided to write a module to make it easy for non coders.  It’s written for Joomla 2.5.  It might work with 1.5 but I haven’t tested it.

 

A couple of things that you might want to know.

 

You can change the button format easily by editing the tmpl/default.php file.  I chose a button because it suited my site but it’d be easy to have it as text or a custom button etc.  You could even extend the module to allow you to choose which you want.

 

To use the module just load it by going to extensions and load in the normal way.

 

Now go to module manager and publish the module in the position you want the button to appear.

 

Alternatively do what I did.  Type a something like loguseroutmodule  into the publish position for the module.  Next go to the article or module where you want to place the button.  Find the position and type {loadposition loguseroutmodule } and the button will appear at the point.  I used a custom HTML module and put in other feature like edit the user profile and images.  It just gave the user the type of information that they would readily need in one customised box.

 

Any questions leave a comment and I’ll try to answer them.

 

Here is the zip file to upload: mod_logoutuser

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Archives