I'm just setting up a Drupal installation where guest are able to submit content of a special node type (CCK form). To make moderation possible new items of that node type are unpublished by default. Whenever a guest submits a form, drupal automatically directs her/him to the page of the created node. Because guests don't have permission to see unpublished content the user gets an "Access denied" error.
It makes sense not to show guests unpublished content, anyhow I would like guests to either see the preview of their own article, beeing redirected to the start page or to hide the "acces denied" message after completing the form.

Thank you

Sophia

Comments

upupax’s picture

You can force user to preview his node before submitting it.
Go to "admin/content/node-settings" to select this option.
To hide the access denied you can create an action that redirect user to a specific node after content submission.
In this node you can write your "Thanks for posting" message.

sophia g’s picture

Creating an action sounds like what I am looking for. Can you tell me how I do that?

upupax’s picture

To create a redirect action:
1. Create your "thanks for submitting" page and have a look at its path;
2. go to site configuration > actions;
2. create a redirect to url action that point to your thanks page;

To assign an action:
1. if you don't have Trigger module enabled (core module in drupal 6.x) you must enable it;
2. go to site building > triggers;
3. in the "content" tab you have actions you can assign to each content event: find the "Trigger: After saving a new post" and assign it your custom redirect action.

That's all..
Now everytime a node is saved the user will be redirect to your thanks page.

sophia g’s picture

Thank you very much for your help. The problem is that an action has to be used for all node types/roles. I want the redirect only to take place if new content is published by a guest or if new content is of a particular node type.

upupax’s picture

Then you can try with module Rules.
It's more flexible then actions, and give you the ability to set conditions like per roles rules or things like this.

ntg’s picture

Thank you very much for your help. That was exactly what I needed :).

Moscow’s picture

Hi,
I encountered the same issue as Sophia. Thanks for the tips.

PS. frankly, it is strange that such a behaviour is left by default in drupal's core. It is quite misleading for an anonimous to see 403 msg after posting the contents.