Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm trying to embed the body of a node (in this case, of type "Block" which I created) into a Block. However, there does not seem to be any way to hide the hotlinked title of the node from that Block. Perhaps I'm missing how to do this (I can't find documentation for Nodes in Block). I've even tried installing the "Exclude Node Title" module and excluding the title for the node, but that didn't work on these embedded nodes.
Any suggestions welcome. Thanks!
Comments
Comment #1
swentel CreditAttribution: swentel commentedIndeed, the title is hardcoded in the node.tpl.php of Drupal core. You can either change this template and use the nodesinblock property on the object (see under) or try installing Display Suite. That gives you full control over the display of any piece of content through the UI.
Comment #2
flightrisk CreditAttribution: flightrisk commentedI have Display Suite installed. How do I remove the title just for the "nodes in block 1" block title?
Comment #3
mari3.14 CreditAttribution: mari3.14 commentedI do not have display suit but if you are still interested in editing node.tpl.php you can try the following:
Look for the following code:
if (!$page && $title):
Change it to read as follows:
if (!$page && $title && (!isset($node->nodesinblock))):
The new code adds a condition so that the title of the node is printed if the node is not a nodesinblock node.
I hope the above helps.
Comment #4
amogiz CreditAttribution: amogiz commentedSorry but i did not find the code you mentioned in the node.tpl.php …
Comment #5
mari3.14 CreditAttribution: mari3.14 commentedOh, I have just seen your message. Gosh, I forgot to mention that I am using the Zen theme as a base to build my own theme.
In the Zen theme the line I mentioned is line 90 of node.tpl.php
I will keep an eye on this issue, if you haven't solved this, what is the theme you are using? I will try to help.
Comment #6
mari3.14 CreditAttribution: mari3.14 commentedOr you can try the following code which will work with any theme:
Open node.tpl.php
On the top of the file (or after the initial comments) open a php tag
Then write the following code
if (isset($node->nodesinblock)) {
$title = ' ';
}
Close the php tag.
Please notice that this suggestion and my previous one above (number 3) will hide the node title in all your nodes in blocks.
Good luck.
Comment #7
sokrplare CreditAttribution: sokrplare commentedSee patch provided in #1463806: Possibility to hide block title