Problem adding button to custom content type form I am trying to add a cancel button to a custom content type form (typename/type/add).
I have looked around and there seems to be two main ways of doing this:


Creating a template file with the name page--node--add--typename.tpl
Implementing the hook_form_alter either in the theme template.tpl.php or in a custom module.


then adding code like 

$form['actions']['cancel'] = array(
    '#type'   =&gt; 'submit',
    '#value'  =&gt; t('Cancel'),
    '#access' =&gt; TRUE,
    '#weight' =&gt; 55,
    '#submit' =&gt; array('cancel_button_form_cancel', 'node_form_submit_build_node'),
    '#limit_validation_errors' =&gt; array(),
);


In the first case,  after rendering the form with drupal_render($form) the button is added but only the form is rendered. Main menu and other blocks are not rendered.

However in the second case the button never appears. Even though something like drupal_set_title('Title') does change the title.

Any solution to either issue would be most welcome.

Edit
The first part of this question is now a separate one here.
Ok found the problem with implementing the hook, I copy pasted the code from some post and it was passing $form variable by value. The correct signature of the alter_form should be

modulename_form_alter(&amp;$form, &amp;$form_state, $form_id)