I can’t add a form to a node. Using the following code, the generated HTML show only the node. If I return $form, the form is rendered correctly. What is my mistake ?
function hook_menu() {
$items[‘presse/rss’] = array(
'title' => 'RSS', 'access callback' => TRUE, 'page callback' => 'press_rss_page', 'page arguments' => array('fr'), 'menu_name' => 'nav-fast-links-fr', 'file' => 'press.rss.inc', 'type' => MENU_NORMAL_ITEM,
);
FILE: press.rss.inc
function press_rss_page($lang) {
$nid = variable_get('press_rss_nid_' . $lang, 0); $page = array(); if ($nid) { $page = node_view(node_load($nid)); } $path = $_SERVER['HTTP_HOST']; $path .= $lang == 'fr' ? '/presse/rss/' : '/press/rss/'; $form['#weight'] = 1000; $form['container'] = array( '#prefix' => '<div class="rss-url-block">', '#suffix' => '</div>', ); $form['container']['all']['title'] = array( '#markup' => '<h3>' . 'All the press room content' . '</h3>', ); $form['container']['all']['text'] = array( '#type' => 'textfield', '#title' => t('All the feeds', array(), array('context' => 'frontend')), '#value' => $path . 'all', '#disabled' => TRUE, '#id' => 'rss-1', '#attributes' => array( 'onClick' => "this.select();", 'readonly' => 'readonly', ),
);
$page['form'] = $form; return $page;
}