I'm using a content type for Clients and another content type for Tasks. Each client has many tasks and each task belongs to one client. Both types are connected by a reference field defined for the Task content type that points to a Client node.

I know how to display a Client's information together with a list of all Tasks for that client. I'm using a view in a block that is parameterized with the Client node ID. That was easy.

However, in order to create a new Task for a Client, I need to display the Client's information together with the create new task form.

Is there any way I can do that in Drupal 7?

1 Answer 1


If you need to put that info in a block near the form, you can create your custom hook like

function mymodule_menu(){
  $items = array();
  $items['mynode/add/%/%'] = array(
      'title' => t('Create content'),
  'description' => 'Calls to a drupal_get_form',
  'access callback' => 'user_access',
  'page callback' => 'my_function',
  'page arguments' => array(2,3),
  'access arguments' => array('access content'),
  'type' => MENU_CALLBACK,

 return $items;

So now you have a page called /mynode/$type/$id_user

In that page you can render the form of that content type using drupal_get_form() and returning it rendered. Now in the blocks config you can add your block view to the pages called /mynode/mytype/* , getting the user id argument from the url will let you render that view with the user data.

  • Thank you very much! I'll give this a try and I'll come back here to report what happened.
    – David
    Commented Nov 7, 2012 at 13:22
  • If you have any problem, tell me.
    – rafinskipg
    Commented Jan 4, 2013 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.