Hello Guys, If my blog posts are helpful to you then give some comment and ratings, if you found any bug also. So that if there are bugs or issues, I can resolve those bugs in next versions.

Changing a Login Menu Link to Logout

I have seen the question: "How do I change my Login menu link to read Logout?" asked number of times and in various ways in forums and on blogs.

If you use the User > Login > Default Login Layout (Figure 1) link in any of your Joomla menus, you've probably noticed a couple of limitations associated with it. One limitation is that the name of the link doesn't change, or rather, there is not an option to change the text for users who have successfully logged into the site.

Figure 1

Well, there is a relatively simple solution using a third party extension called MetaMod. Follow the below steps :


Step 1: Create a Joomla 'Login' Menu Item

To start, create a link called "Login" on the "Main Menu" in a default Joomla installation. If you don't know how to do this, then tracking down a more basic Joomla tutorial on creating menu items would make things easier. Remember to publish the menu item.

Step 2: Make a copy of the Menu

Next, use the Menu Manager to make a copy of the Login menu that contains the 'Login' link.
After saving the new menu, you'll want to immediately select it in the Menu Manager to edit one of the fields that Joomla created for you. The field is called 'Unique Name'. It will contain the same text you entered for the other fields. For consistency and to stay true to the tooltip recommendation, you'll want to change it to a name without spaces. It's probably not a bad idea to keep it short and only use lower case characters too.

Step 3: Edit the 'Login' Menu Item on the New Menu

While in the Menu Manager, select the icon in the 'Menu Item(s)' column. You'll want to select the 'Login' menu item to edit its details. Change the value of the Title' field to 'Logout'.

Step 4: Configure the Menu Modules

After you have made a copy of the menu containing your link, you'll need to edit a few of the settings for each menu module. In the Joomla Module Manager, click on the new module to edit its settings.
Review the following settings and change where necessary:
Details:
  • Show Title: 'No'
  • Enabled: 'Yes'
Menu Assignment: 'None'

For the original 'Login' module, use the same settings. You'll probably want to change the title of this module too for consistency.

Step 5: Configure the 'MetaMod' Module

Here's where the magic happens. If you haven't used MetaMod before, it's one of those invaluable third party extensions that every Joomla site should have installed (no we don't know the developer and he didn't pay us to say that).
Using the Joomla Module Manager, locate the 'MetaMod' module and click on it to edit its settings. If you just installed MetaMod, there should be an instance that is unpublished. If you had it installed previously and are using it for something else, simply select 'New' in the Menu Manager to create a new instance.
Review the following settings and change where necessary:
Details:
  • Title: 'Main Menu'
  • Show Title: 'Yes'
  • Enabled: 'Yes'
  • Position:
  • Access Level: 'Public' (otherwise there's no point in displaying a login link)
Menu Assignment: 'All' (or on whichever particular pages you want it to appear)

Figure 2

Figure 2: The MetaMod code
After filling in the basic information, look at the Parameters > Module Parameters section on the right side of the page. If your original menu had a Module Class Suffix, you'll want to fill that in at the top. Then, about half way down the page, in the 'PHP' text box, type in the code as depicted in Figure 2, replacing my module ID numbers with those that correspond with your Joomla site.

2 comments:

Anonymous said...

I Don't understand
Can you help me? pleaseeee...

Unknown said...

Hi Wiyono,

Sure I will help you, Can you please tell where you are understand...

Comment here where you strucked...

or

Ping me to my gtalk so that I can tell you clearly...see my contact page..

Post a Comment

Follow fornandakishore on Twitter