first module, hook_menu/FAPI problem I'm fairly new to Drupal and made my first module. It works. Yay!

What I have: Calling
/form-test/186 (nid)
Nid gets loaded, renders content.

What I want: The same but with an simple submit button at the end, that calls a 

function exportIt() {
  // put $output from formtest_page() in email
}


when clicked, not before.

    &lt;?php


/**
 * Implements hook_menu().
 */
function formtest_menu() {
  $items['form-test/%'] = array(
  'title' =&gt; 'Export von:',
  'page callback' =&gt; 'formtest_page',
  //'page callback' =&gt; 'drupal_get_form',
  'page arguments' =&gt; array(1),
  //'page arguments' =&gt; array(formtest_simple_form),
    'access arguments' =&gt; array('access administration pages'),
    'type' =&gt; MENU_CALLBACK, );
  return $items;
}

function formtest_page($nid = NULL) {

  $node = node_load($nid);
  if ($node) {
    $title = $node -&gt; title;
    dpm($node); //Why is this not get displayed?
    drupal_set_title('Klicket Export von: ' . $title);
    $output = '';
    $items = array("&lt;b&gt;titel: &lt;/b&gt;" . $title,
    "Where is my beef?" );

    $output .= theme('item_list', array('items' =&gt; $items));
    //drupal_get_form('formtest_simple_form');
    return $output;

  }
  return;
}

function exportIt() {
  // put $output from formtest_page() in email
}

//simple submit form
function formtest_simple_form($form, &amp;$form_submit) {
$form['submit'] = array(
'#type' =&gt; 'submit',
'#value' =&gt; t('Export an Klicket'));
return $form;
}


I'm having basic conceptional issues I guess. I either can render the submit Button or the Output, but not both.
The correct code is similar to the following one.

I will add some notes about the code as I wrote it:


If you use "form-test/%node" (instead "form-test/%"), the node will be loaded from Drupal, and if there are some problems with loading it, it will report an error (404, page not found) to the user; in this way, you don't need to call node_load() as that is already done by Drupal.
There is a callback that returns the title Drupal should use.
I am not sure I translated correctly the strings you were using (I guess it was Swedish, but I am not positive, as I don't know Swedish); I had to translate the strings, as t()'s argument is a string in English, which will be translated in the language set for the site.




function formtest_menu() {
  $items['form-test/%node'] = array(
    'title' =&gt; 'Export',
    'title callback' =&gt; 'formtest_title',
    'title arguments' =&gt; array(1),
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array(formtest_simple_form, 1),
    'access arguments' =&gt; array('access administration pages'),
    'type' =&gt; MENU_CALLBACK,
  );

  return $items;
}

function formtest_title($node) {
  return t('Export Klicket from @title', array('@title' =&gt; $node-&gt;title));
}

function formtest_simple_form($form, &amp;$form_state, $node) {
  $form['#node'] = $node;

  $items = array(
    t("&lt;strong&gt;Title: @title&lt;/strong&gt;", array('@title' =&gt; $node-&gt;title)),
    t("Where is my beef?")
  );

  $form['item_list'] = array(
    '#theme' =&gt; 'item_list',
    '#items' =&gt; $items,
  );

  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Export as Klicket')
  );

  return $form;
}

function formtest_simple_form_submit($form, &amp;$form_state) {
   // Write the email.
   // If you need the node object, it is in $form['#node'].
}