Joomla!
http://forum.joomla.org/

Login module on static page...
http://forum.joomla.org/viewtopic.php?f=32&t=36655
Page 1 of 1

Author:  mohakem [ Wed Feb 08, 2006 6:05 pm ]
Post subject:  Login module on static page...

I have created a static page 'login'. I want a seperate login page since only a few users will be needing it and there is no need to have it on the main page taking up space.

However, when i try and set the module onto this particular page, it doesnt show up. However, when i set it to 'all' (ie: show on all pages) it does show up.

Why does it not show up on the static page only????

Regards.

Author:  Nic [ Wed Feb 08, 2006 6:15 pm ]
Post subject:  Re: Login module on static page...

What I usually do:

1. Create a static content item "Login" with some introductory text
2. Create a "Link - Static Content" menu link for that new static content item in an unpublished menu
3. Go to "Modules" and assign the "Login Form" Module to that new static content item
4. Assign the "Login Form" Module to a module position that is not in use by any other modules (e.g. user9)
5. Edit your template's index.php file and add right below the
6. Go to the menu manager and to that unpublished menu and check the url of the new Login static content item (e.g. index.php?option=com_content&task=view&id=11&Itemid=22)
7. Create a folder "login" in the root of your website
8. Create a new index.php file in that "login" folder with this content:

That's it. Now someone can just enter http://www.yourdomain.com/login and gets a nice login page.

Hope this helps.

Nic

Author:  mohakem [ Wed Feb 08, 2006 7:10 pm ]
Post subject:  Re: Login module on static page...

Hello, thanks for the reply.

I followed out your instructions but still to no avail. When i input http://www.myurl.com/login it does take me to the 'login static content page'. However, there is no login module shown on this page.

I still can't understand why its not working ... ???

Regards.

Author:  Nic [ Wed Feb 08, 2006 7:59 pm ]
Post subject:  Re: Login module on static page...

Hmm, no clue.

Make sure the Login Module is published of course. Maybe try assigning a different module to the same slot and to that  static content item to see if that works?

Author:  mohakem [ Wed Feb 08, 2006 8:05 pm ]
Post subject:  Re: Login module on static page...

Good idea... it seems to be a problem with the login module, as the other modules are showing. Just the one i needed as well...

thanks for your help anyway,
Regards.

Author:  Nic [ Wed Feb 08, 2006 10:02 pm ]
Post subject:  Re: Login module on static page...

The other modules work with the same position/assignment? That is really strange. What happens when you assign the Login Form module to ALL, but keep it at the new module position ("user9" or whatever)? Does it show on all pages AND on the login page?

Author:  mohakem [ Thu Feb 09, 2006 2:36 pm ]
Post subject:  Re: Login module on static page...

No, the login module did not show at all, even when on 'All' .

However, i just switched it back to another position, and it seems now to be working (even though that position was not initially working/showing the module) 

??? But it works now at least.

Thanks for your help.
Regards.

Author:  Nic [ Thu Feb 09, 2006 2:37 pm ]
Post subject:  Re: Login module on static page...

Hmm.. well, as long as it works  :laugh:

Glad you're problem is solved!

Nic

Author:  bendiga [ Sun Feb 12, 2006 6:29 am ]
Post subject:  Re: Login module on static page...

I'm having a similar problem. I am creating a private family site and I would like to have a simple static login page at my main domain that leads to the members folder which contains Joomla. 

I followed the directions above, but it didn't work for me either. I tried it to the letter, and then I tried it my own way, attempting to make the login page in my root directory instead of in the Joomla folder.  I'm sure it's because the directions didn't make sense to me in the first place.  Why would you need such a convoluted method to do such a simple thing in a program like Joomla?

There must be a better way to do it, or a better way to explain what Nic is trying to tell us. 

*** Also, if anyone can help with a simple login page that people could log into only once and be able to view the SMF forum and the Gallery2 gallery.  I installed Community Builder, thinking that would shed some light on it.  nope.

Author:  Nic [ Sun Feb 12, 2006 11:56 am ]
Post subject:  Re: Login module on static page...

bendiga wrote:
I'm having a similar problem. I am creating a private family site and I would like to have a simple static login page at my main domain that leads to the members folder which contains Joomla. 

I followed the directions above, but it didn't work for me either. I tried it to the letter, and then I tried it my own way, attempting to make the login page in my root directory instead of in the Joomla folder.  I'm sure it's because the directions didn't make sense to me in the first place.  Why would you need such a convoluted method to do such a simple thing in a program like Joomla?

There must be a better way to do it, or a better way to explain what Nic is trying to tell us. 

*** Also, if anyone can help with a simple login page that people could log into only once and be able to view the SMF forum and the Gallery2 gallery.  I installed Community Builder, thinking that would shed some light on it.  nope.


That is the beauty of Joomla - most of the times there are many ways to achieve things, it all depends on what you need. If you just want a simple login page use the built in one by linking to "index.php?option=com_login&Itemid=1". That is definitely the easiest way.

The method I described above gives the greatest flexibility - in my opinion. It gives full control over the layout and content of that login page, it results in a regular joomla item that can be styled and filled with whatever content one desires, even have a template assigned to it or whatever.

And for the method being "convoluted", well, that is true but it takes me about 1 minute to follow the whole procedure, so I don't care  :D

About your problem: it is probably not working because you have your joomla in a folder, so you need to adjust the path in the login/index.php to lead to your Joomla installation, something like this: [url=http://www..com//index.php?option=com_content&task=view&id=XX&Itemid=YY]http://www..com//index.php?option=com_content&task=view&id=XX&Itemid=YY[/url]

Cheers,
Nic

Author:  runlow [ Tue Feb 14, 2006 9:08 pm ]
Post subject:  Re: Login module on static page...

bendiga wrote:

.... I followed the directions above, but it didn't work for me either......


I had the same outcome. I poked around abit and noticed I didn't apply/assign the template I'm using in the rest of the site to the new login page that I created (per directions above).

Once I assigned the template to the new login in page in the template manager, the login form showed up where it was intended.

Not sure the relationship it has with the template I'm using yet....I'm still new.

Author:  bendiga [ Wed Feb 15, 2006 9:46 pm ]
Post subject:  Re: Login module on static page...

First, I'd like to apologize to Nic for being a dumb*ss  I didn't realize there were any manuals available for joomla and I lacked a basic understanding of how it worked.  When I found what documents exist, I read through most of them and it helped immensely.

I reinstalled Joomla into my root this time.  Also, I am using a template that puts the "main menu" into tabs across the top horizontally.  What I wanted was a simple login page in my root directory, so that anyone that comes here must log in before viewing anything.  But, now with Joomla in the root directory, I ended up trying to put the login into the first tab shown, which came out pretty nice.

It was really simple to do this. Plus, it allows you to add text to it, so it's pretty much the same as Nic's "convoluted" method above.

Quote:
1. Create “Link – Component” to “Login Form” in main menu and set it to position one. Make sure all the private areas in the main menu are set to “registered”.

It's a neat effect when you log in and all the other tabs appear.


Okay, but I wasn't satisfied with this method because the Login tab never goes away!  You can redirect to another page (I redirect to my Home [Frontpage]) when they log in, but the Login Tab stays put.  It would be better if it turned into a very small LOGOUT button someplace else.

Anyway, I tried to adapt Nic's method above to my needs to see if it helped and here's what I came up with. (Remember, I don't want anyone to have to go to http://www.mydomain.com/login in order to log in.  I just want it there when you type the main domain.)

Quote:
1. Create a static content item "Login" with some introductory text

2. Create a "Link - Static Content" menu link for that new static content item in the main menu and place it in position 1.

3. Go to "Modules" and assign the "Login Form" Module to that new static content item

4. Assign the "Login Form" Module to a module position that is not in use by any other modules (e.g. user9)

5. Edit your template's index.php file and add right below the




This ended up creating the exact same thing as the easier method.  I may have more control over the layout now, though, so that's a positive step forward. I haven't had a chance to really play with it yet.  But, the tab still stays there when you're logged in.  So, am I totally barking up the wrong tree here?  Is there any way to do what I'm trying to do?

Author:  bendiga [ Wed Feb 15, 2006 11:11 pm ]
Post subject:  Re: Login module on static page...

I was able to create a great solution for logging out.  I just created a "Link - URL" to "index.php?option=logout" in the main menu, set it to "registered" and placed it in the order I want it in.  It only appears after I log in, and redirects me where I want when I log out through the "Login Form" module.

But, how do I hide the "Login" page from the logged in users?  If I could just do that...  it would be perfect.  I just can't seem to find any way to show something to the "public" yet hide it from the "registered" members.

Author:  bendiga [ Thu Feb 16, 2006 4:34 am ]
Post subject:  Re: Login module on static page...

Okay, I got it working, but I'm not sure if this is a good way to do it.  I First had to take the "Login" link out of my "main menu" so it wouldn't show up there at all.  Then I edited the "Login Form" module to:

1. point to "Home (Frontpage)",
2. have a position like "user9" in Nic's example above. 

Finally, I had to insert the code, example: into the index.php page of my site's template (right below the )and make all sections, categories and content on the home page (like Popular and Newsflashes) restricted to registered users only.  I think that's all I did, but it's been a long day and I'm not totally sure.

It seems to be working great (Except for a small message, "You are not authorized to view this resource.
You need to login.", that doesn't need to be there on the Home/Login page.  Anyone know how to change that little thing?). 

When I go to the domain, all that is there is the login form and a few other things I want there.  And, the rest is hidden.  Then when I log in, all the links and content magically appear including the new Logout tab.  Another snag: The Logout button from the original Login form is left hanging out at the bottom of the content on the home page.  I guess I can live with that for now.

Overall, it's really coming along.  And, Joomla is fun.  Thanks for all your help everyone. ;D

Author:  leolam [ Thu Feb 16, 2006 6:23 am ]
Post subject:  Re: Login module on static page...

maybe i missed something here:

I can place any module within a content without having to hack my index.php or any page at all!...

you take the login-form as per example (this is valid for any module!) . Assign the mod to module position: user9
no need to change anything > save

in your content where you want to show the login-form place this {mosloadposition user9} > save and you are done...The login form shows where you positioned it on the page where you placed the {mosloadposition user9}

That's all what's needed. It is driven by the mod Load Module Position (see your admin panel > mambots

Author:  thejomo [ Fri Feb 17, 2006 4:11 pm ]
Post subject:  Re: Login module on static page...

This has been a useful thread and contains the same spirit of what I am trying to achieve as well.  Essentially, what I want to do is mimic the "backend" (joomla administrator) login process for the "frontend" experience as well.

My site is a private site, so my goal is to have the login page display (with just the Joomla login module) when you connect to the domain (i.e., http://www.mysite.com).  Just as the backend Admin portal does, any URL you try to reach when not logged into the site would redirect you to the login page.

My initial thoughts are to create my own template which would only define 1 or 2 template positions and then assign that template only to my login page, which would include only the login module.

The true "magic" would be in knowing whether the user was logged in or not and then automatically redirecting them to the login page if they weren't.  Again, mimicking the Admin backend's login procedures, but doing it for the front end.

Any thoughts on how this can be achieved?

Author:  thejomo [ Tue Feb 21, 2006 9:23 pm ]
Post subject:  Re: Login module on static page...

Actually - I found what looks to be a great thread on this very topic.  I haven't yet attempted this, but there are enough positive responses to it, that I figure it is worth sharing in this thread:  http://forum.joomla.org/index.php/topic,1483.0.html

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/