Hook_menu to Form with %node wildcard I have a content type 'school' and an entityform that's called 'contact'...

I would like the URL path for the contact form to be:

www.example.com/node/nid/contact

It's important that the node ID be passed in the link to the entityform in this format rather than:

www.mysite.com/eform/submit/contactform?some_custom_field=[nid]

so that people can share the contact form easily.

It's also important that the contact form be an entityform

Any pointers to set up my entityform url so that it reflects the NID of the content that linked to it? 

I am trying to set up URL alias for the entityform but am having trouble setting up the NID as a wildcard.


  EDIT for my helper module I have...(we can ignore the entityform part of my question because I'll probably re-build the form) ... I am trying to get the letter generator to appear at /node/%node/lettergen but the %node wildcard isn't working ... 


function lettergen_menu() {
$items = array();
$items['node/%node/lettergen'] = array( 
'title' =&gt; 'Letter Generator', 
'description' =&gt; 'Generate a Letter'
'load arguments' =&gt; array(1),
'page arguments' =&gt; array('lettergen_form', 1),
'access callback' =&gt; TRUE,
);
return $items;
}



  THIS WORKS


function lettergen_menu() {
$items['node/%node/lettergen'] = array(
'title' =&gt; 'Lettergen',
'description' =&gt; 'A form to mess around with.',
'page callback' =&gt; 'drupal_get_form',
'page arguments' =&gt; array('lettergen_form', 1),
'access callback' =&gt; TRUE,
);
return $items;
}
One of the option is:


create a entity reference field in 'school' content type to reference associated contact form.
write a helper module that adds a menu item node/%node/contact.
Make sure access_callback check for your content type and return false for other node type to avoid any perf issue.
In menu callback function, render the entity form to display.


Here is an example of "node/%node/something" pattern from token module.



/**
 * Implements hook_menu().
 */
function token_menu() {
  ...
  ...  

  $items['node/%node/devel/token'] = array(
      'title' =&gt; 'Tokens',
      'page callback' =&gt; 'token_devel_token_object',
      'page arguments' =&gt; array('node', 1),
       // 'node' =&gt; token_devel_token_object function gets a string 'node' as argument 1 
       // 1 =&gt; token_devel_token_object function gets a node object of node id given in url. for mode details refer https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_load/7.
      'access arguments' =&gt; array('access devel information'),
      'type' =&gt; MENU_LOCAL_TASK,
      'file' =&gt; 'token.pages.inc',
      'weight' =&gt; 5,
    );


// page callback definition
/**
 * Menu callback; prints the available tokens and values for an object.
 */
function token_devel_token_object($entity_type, $entity) {
...
...
}