Joomla! Discussion Forums



It is currently Sun Nov 08, 2009 5:09 am (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
Posted: Sat Apr 07, 2007 5:42 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Sat Apr 07, 2007 3:22 pm
Posts: 3
Hi, this has probably already been answered but I have spent half a day searching the help files and forums with no success.  It is probably pretty simple HTML code but so far I cannot get anything to work.

How can I create a menu item which will display as "Login" when a user has not logged in and as "Logout" after a user has logged in?

I do not want to display the login form as static content, only the link on a menu.  The only way I have found is to create a new menu item for com_login with a static title.  I have been working on this off and on for four days now and am getting very frustrated.

Thanks for any help which anyone can give me.


Top
  E-mail  
 
Posted: Sun Apr 08, 2007 10:26 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 10:41 am
Posts: 15089
Moderator note; duplicate post removed, cross posting is not allowed according to forum rules.

_________________
Regards Robin


Top
   
 
Posted: Sun Apr 08, 2007 10:32 am 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Mon Jan 01, 2007 7:14 pm
Posts: 86
Location: Germany
This thread may be of use to you, I used this myself for my site and it works flawlessly:

http://forum.joomla.org/index.php/topic,117512.0.html

_________________
+~* http://www.fairywitch.net/*~+ - Blog & some joomla! info
+~* http://beewitched.fairywitch.net*~+ Sims 1 downloads


Top
  E-mail  
 
Posted: Sun Apr 08, 2007 6:40 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Sat Apr 07, 2007 3:22 pm
Posts: 3
Thanks, That looks like exactly what I want.  :)

Sorry about the double posting but if you put something in the wrong category there does not seem to be any way to delete it.


Top
  E-mail  
 
Posted: Tue Apr 10, 2007 3:31 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Sat Apr 07, 2007 3:22 pm
Posts: 3
Now that I have had a chance to try this I find that it is not quite what I wanted.  I want would like is what appears to be a single item on a menu which changes from login to logout.  (The logout part works just fine).

Does anyone have any further ideas?


Last edited by 00ian on Tue Apr 10, 2007 4:10 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Thu Apr 19, 2007 7:59 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Sep 15, 2006 6:46 pm
Posts: 34
The solution I came up with (hat tip to other posters), was creating two almost identical menus: One for showing when you are not logged in (ie. containing a 'Login'-item) and one for showing when you are logged in (ie. containing a 'Logout'-item in the place where the 'Login'-item was) and then modifying the index.php of my template - Step by step it looks something like this:

In the backend:
  • Go to Site, Template Manager, Module Positions
  • Create 2 new module positions: TopGuest and TopReg
  • Go to Menu, Menu Manager
  • Create 2 Menu's: topmenuguest and topmenureg
  • Go to Menu, topmenuguest
  • Add the content you want shown when you are NOT logged in
  • Go to Menu, topmenureg
  • Add the content you want shown when you are logged in
  • Go to Modules, Site Modules, topmenuguest
  • Assign it to position TopGuest
  • Go to Modules, Site Modules, topmenureg
  • Assign it to position TopReg
  • Open your index.php of your template
  • Add the following in the appropriate place
Code:
<?php
if ($my->id) {
  mosLoadModules ('TopReg');
} else {
  mosLoadModules('TopGuest');
}
?>


Further I've created a 'full-page' Login-page by: Creating a content-item, using mosmodule (from http://www.ongetc.com/) to include the Login-module in the content-item (just in case you wondered -  ;D) -

Cheers -


Top
  E-mail  
 
Posted: Fri Jul 06, 2007 8:00 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue May 30, 2006 10:00 am
Posts: 6
Thank you, hlarsen

this was helpful.


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

Quick reply

 



Who is online

Users browsing this forum: Google [Bot] and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group