Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
node system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Oct 2009 at 04:25 UTC
Updated:
4 Aug 2011 at 08:01 UTC
In D6 the node title can be hidden with using the third parameter in the node_view() function.
http://drupal.org/update/modules/6/7#node_view
$nstruct = node_build($my_nid, 'teaser');
$output = drupal_render($nstruct);
This code should replace node_view in D7, but there is no way to hide the node title as the template_preprocess_node() always expects that there is a node title and node.tpl.php always displays it.
The attached patch is not a really good solution just a quickfix.
to hide the node title add unset($nstruct['#node']->title); before drupal_render
| Comment | File | Size | Author |
|---|---|---|---|
| node_title.patch | 1.05 KB | pasqualle |
Comments
Comment #1
pasqualleComment #2
conortm commentedLooks like this issue is moot per #658364: Does build/view/formatter terminology make sense?. I've contacted Pasqualle to confirm and close.
Comment #3
retester2010 commentednode_title.patch queued for re-testing.
Comment #5
murzIs there any recommended way to hide node title on current Drupal 7.4 version without this patch?
Comment #6
rvb commentedHi Murz,
I found this module that excludes node titles by content type or by specific node: http://drupal.org/project/exclude_node_title
But with my D 7.4 install it's still not working.
Maybe you have more luck. Let us know if you have a solution.
Comment #7
marcingy commentedMoving to a support request as the original issue is not a bug.
Comment #8
rvb commentedI designed my Drupal 7.4 template with Artisteer 3, that's probably why I have this issue.
The Exclude node title module didn't work, but I changed the node.tpl.php code:
Original:
----------
echo art_node_title_output($title, $node_url, $page);Enhanced:
--------------
where nid are the node IDs of the pages where I don't want the title to be displayed twice.
Comment #9
pasqualle- the section for node_view in the D6-D7 module update handbook is removed.
the title can be hidden as
code from ctools\plugins\content_types\node\node.inc ctools_node_content_type_render()