By pknag on
I have installed drupal 4.7.5 and I am still configuring it. I installed the front_page module with the hope that anonymous users will see a different page than authenticated user. It does that but it has a bug/feature that I would like to solve. After a user logs in it still displays the front page meant for the anonymous user. Only after clicking the 'Home' or the page Title up on the left upper corner does it go to proper page meant for the authenticated user. I would like this page to be automatically loaded. Is this possible? Or should I use some other module or scheme to achieve this?
Comments
More info on the problem
I have redirected the anonymous user to node/1
and authenticated users to node/2
Both nodes exist. But once a user logins, the node/2 is not displayed until one clicks the 'Home'
Is there a fix for this?
Talking to myself
Since no one has answered yet I thought I would just talk to myself again.
Added two roles. Assigned two users to these two roles. Installed the latest front_page module so that I can have custom front page for each role. Observed the same thing. The custom front page does not autload on login. It shows the same page as the anonymous user.
login destination.
You can work around this by trying the login destination hack here: http://drupal.org/node/82251 or creating a custom LOGIN block that forces the login destination to the front page. Note the Form action in the snippet below. You can configure the block to only appear for Anonymous Users.
The only problem with that is it creates confusion for users who try to access a page, but, are not logged in and when they login, instead of being brought to the page they were trying to access, they are forced to the front page.
In other words, it's probably a bad idea to force the login destination.
(you may need to change paths in this snippet depending on your installation)
It's better to raise an issue for something like this rather than post on the forum: post any follow ups at this issue thread: http://drupal.org/node/98466
Philk
Will try this and thanks
Hi Philk,
Thanks, this looks very promising. I like the front_page module and what it is supposed to do. I will post my findings on the issue thread. Learnt a lesson today. Did not know that the issue thread existed, otherwise I would have looked at that first. Thanks a lot.
-PK
welcome
you're welcome. It's worth mentioning that it's not really a good idea to use redirects for the front_page, espedcially for anonymous users. It's better to use the text are provided by the module for the reasons outlined below in my other post (redirecting resets the LOGIN DESTINATION for the login form away from 'front_page')
Phil
Redirect to page
I'd prefer to redirect anonymous user to a page because I'd like to give them the ability to "comment". For some reason, when I redirect anoy, the same page shows up for authenticated.
Or can I somehow add the ability to comment in frontpage?
Thanks Phil.
what text etc have you got
what text etc have you got in your front_page settings? i've been using the frontpage module for a while now and haven't had any problems
he's using redirects for anon users
Hi Stan,
It's not really a problem with the front_page.module it's a simple problem when using REDIRECTS.
As an example: If the front_page settings for anonymous user is set to REDIRECT to 'node/4'...when an anonymous visitor comes to the site, they land on 'node/4' for the front page - and thus the login destination in the LOGIN FORM is 'node/4' - so when that visitor logins in, they will be brought to 'node/4'.
The correct usage is to use the text area for Anonymous User on the front_page settings page instead of redirecting. By using the text area to set the front page for anon users, it means the LOGIN DESTINATION is 'front_page' for the LOGIN FORM when a visitor lands on the site, so when the visitor logs in, they see the front_page for authenticated users.
Perhaps the readme.txt file might have a note about that. it's a simple mistake to make.
Phil
anon redirect - that was the problem
Feel silly. That was the only thing I never tried. That is put some text in the body for the anonymous user instead of using redirect. Redirecting that does cause the problem i was talking about. Works like a charm now.
we've all been there...
we've all been there...
so...
The correct usage is to use the text area for Anonymous User on the front_page settings page instead of redirecting.
I'm still not sure how to get this working in case when I have nodes that anon users can view, before logging in. If I understood it correctly that would mean that the anon page should be static html and not Drupal content.
I suppose this is also the case when user logs out and front_page still redirects back to auth page, this time without permission to see it?
I've been having the same
I've been having the same problem - however the login destination module sorted the redirect problem
http://drupal.org/node/69051
With this you can still use redirect for both anonymous and authenticated users in the front page module.
I hope this helps