1

I am using the code below to add a form to my node. This renders a page with the node and form on it. Apparently, the node is rendered with its title as a link. I would like to have the node's title without a link. So I tried to change $node->content, but there seems to be no value that determines that the node title is a link. how do I change this with code?

$form = array();
$node = node_load(24)
$form['offer_form'] = array(
  '#value' => drupal_get_form('dt_offer_entry_form', $node),
  '#weight' => 10
);
$node->content = $form;
return node_view($node);
3
  • that title/link behavior is normally dealt with inside of your theme's node.tpl.php template. Often it is based upon whether it is a full page view vs a teaser view. Going in and creating a specific one just for this content type, eg, node--TYPE.tpl.php (D7) or node-TYPE.tpl.php (D6), might be the quickest way to deal with this.
    – Jimajamma
    Commented Mar 3, 2013 at 14:49
  • You could also look at calling node_view() with different $view_mode (D7) or $teaser/$page (D6) arguments to coerce different behavior if your theme supports it. api.drupal.org/api/drupal/modules%21node%21node.module/function/… for more info
    – Jimajamma
    Commented Mar 3, 2013 at 14:55
  • This worked for me: $node_view = node_view($node, FALSE, TRUE); return '<h2 class="title">Voorstel indienen</h2>' . $node_view;
    – user5706
    Commented Mar 3, 2013 at 15:44

1 Answer 1

0

Quoting from this comment, this code worked for the OP.

$node_view = node_view($node, FALSE, TRUE);
return '<h2 class="title">Voorstel indienen</h2>' . $node_view;

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.