How can I hide the title on a specific node?
I have tried the following three modules, but none of them do what I'd like.
I added field_hide_title to the page content type, the code in hook_preprocess_node()
function. It can't work fine.
The value shown from print_r($vars['node'])
is the following:
stdClass Object( [vid] => 4 [uid] => 1 [title] => search_material [log] => [status] => 1 [comment] => 1 [promote] => 0 [sticky] => 0 [nid] => 4 [type] => page [language] => zh-hant [created] => 1339055801 [changed] => 1339727555 [tnid] => 0 [translate] => 0 [revision_timestamp] => 1339727555 [revision_uid] => 1 [body] => Array( [und] => Array( [0] => Array( [value] => [summary] => [format] => php_code ) ) ) [field_hide_title] => Array( [und] => Array( [0] => Array([value] => 1) ) ) [rdf_mapping] => Array( [rdftype] => Array([0] => foaf:Document) [title] => Array( [predicates] => Array([0] => dc:title) ) [created] => Array( [predicates] => Array( [0] => dc:date [1] => dc:created ) [datatype] => xsd:dateTime [callback] => date_iso8601 ) [changed] => Array( [predicates] => Array([0] => dc:modified) [datatype] => xsd:dateTime [callback] => date_iso8601 ) [body] => Array( [predicates] => Array([0] => content:encoded) ) [uid] => Array( [predicates] => Array([0] => sioc:has_creator) [type] => rel ) [name] => Array( [predicates] => Array([0] => foaf:name) ) [comment_count] => Array( [predicates] => Array([0] => sioc:num_replies) [datatype] => xsd:integer ) [last_activity] => Array( [predicates] => Array ([0] => sioc:last_activity_date) [datatype] => xsd:dateTime [callback] => date_iso8601 ) ) [cid] => 0 [last_comment_timestamp] => 1339055801 [last_comment_name] => [last_comment_uid] => 1 [comment_count] => 0 [name] => admin [picture] => 0 [data] => b:0; [entity_view_prepared] => 1 )
============================================================ UPDATE:
but I found one thing. before I change the title to NULL, the title has been displayed out...
print_r($vars) in mytheme_preprocess_page function:
[summary] => [format] => php_code ) ) ) [field_hide_title] => Array ( [und] => Array ( [0] => Array ( [value] => 1 ) ) ) [rdf_mapping] => Array ( [rdftype] => Array ( [0] => foaf:Document ) [title] => Array ( [predicates] => Array ( [0] => dc:title ) ) [created] => Array ( [predicates] => Array ( [0] => dc:date 1 => dc:created ) [datatype] => xsd:dateTime [callback] => date_iso8601 ) [changed] => Array ( [predicates] => Array ( [0] => dc:modified ) [datatype] => xsd:dateTime [callback] => date_iso8601 ) [body] => Array ( [predicates] => Array ( [0] => content:encoded ) ) [uid] => Array ( [predicates] => Array ( [0] => sioc:has_creator ) [type] => rel ) [name] => Array ( [predicates] => Array ( [0] => foaf:name ) ) [comment_count] => Array ( [predicates] => Array ( [0] => sioc:num_replies ) [datatype] => xsd:integer ) [last_activity] => Array ( [predicates] => Array ( [0] => sioc:last_activity_date ) [datatype] => xsd:dateTime [callback] => date_iso8601 ) ) [cid] => 0 [last_comment_timestamp] => 1339039221 [last_comment_name] => [last_comment_uid] => 1 [comment_count] => 0 [name] => admin [picture] => 0 [data] => b:0; [entity_view_prepared] => 1 ) )
.page-node-NID .page-title { display: none;}