By ste5eu on
Ok, here's what I'd like to do.
For an annonymous user visiting my site I'd like them to see a static front page, with login fields off to the side. Once they log in they then get access to the frontpage with the latest updates from across the site displayed.
I've created a page and added it to the content block, that part's cool. However if I set the permissions such that only authenticated users can view the frontpage content then I get a block which says:
Access denied
You are not authorized to access this page.
So how do I get rid of that ?
Comments
I'm assuming you have
I'm assuming you have unchecked the "access content" box on the node module user management. To be honest I haven't really thought this through but couldn't you copy page.tpl.php and call it page-front.tpl.php then just replace
$contentwith static (HTML) content.--------------------------------------------------
Martin - Pedigree Music - Drupal Powered Music Blog
Re: I'm assuming you have
Yes, but as mentioned the problem with no access is that you get the no access message. The problem with replacing the code in the template file is that when you do log in you don't get the data either.
Thanks for the thought though, I'm gonna investigate the frontpage module mentioned in one of the other responses.
Have you gone to
Have you gone to Administer->Site Configuration->Error Reporting and set the default 403 page to point to your new page? Still reports as an error in the error logs, but the anonymous user only sees your new page.
re:Have you gone to
No, but if I do that then I get my new homepage for all no access errors.
The front page module
If you want to serve different content to logged-in and unauthenticated users, install the front page module.
re:The front page module
I'll check this out at the weekend as it sounds like it may be the best option.
Thanks all for your responses.
The error actually appears to occur for all non admin users. I'll post the fix here for future reference when I have it.
rebuild permissions
I had a similar problem and found that after rebuilding the permissions it was resolved.
re:rebuild permissions
When you say rebuild them what do you mean ? Remove them then reapply through the admin interface, or something more ?
try this
go to
http://your_site_url/?q=admin/content/node-settings/rebuild
Rebuild permissions through the site interface above. If still having problems you may need to optimise the relevant database table and that is beyond me but I have seen several posts describing how.
Hope it helps
You know what's funny? this
You know what's funny?
this did happen to me. I use the page-front.tpl.php solution and for some reason "access denied" pops up...
For a few minutes when I access my site it says that... after a few minutes its back to normal... is that some sort of throttling going on?
The answer is ..
The front page module does exactly what I need.
Thanks all for your help.