1

I'm trying to add more buttons to a custom content type form. I create a page--node--add--typename.tpl.php where I modify the form then render it:

$form = node_add('answer');

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

print drupal_render($form);

However this only renders the form. Menus and other blocks are not rendered.

THanks.

1
  • The code is in the template file or hook_form_alter?
    – Sithu
    Commented Feb 13, 2013 at 10:24

1 Answer 1

2

I think you would need to return the form, not print it.

return drupal_render($form);

Printing from a function will cease the theme engine which would cause the other parts of the page not rendered.

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.