Hi,

I have a $content_type and user MUST create only ONE content from it.

If a user already has content in $content_type he needs to be redirected
from the node/add page to his own node/edit page.

I need this because users have custom navigation module
which provides links to a user navigation depending on
different conditions like one above (if user has node -> node/edit page link,
otherwise node/add page) but pages still can be reached by direct URL..

Basically, $content_type => 1 node / user :)

I found many different hooks which looked ok,
but I would like to know, what/which hook you would use as the best Drupal approach?

Many thanks

Comments

WorldFallz’s picture

If you don't want to use the node_limit module, then check how it does it.

Botond’s picture

I decided to use hook_preprocess_page() in my navigation module,
which, before anything else, checks if current_path === node/add/$content_type
and if user already has node in $content_type then goto(node/$nid/edit)

It works like charm.

If you have any thoughts, let me know.