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

swentel’s picture

Status: Active » Closed (works as designed)

Indeed, 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.

// node.tpl.php
if (isset($node->nodesinblock)) {
  // Theming for node in block
}
else {
  // Normal theming
}
flightrisk’s picture

I have Display Suite installed. How do I remove the title just for the "nodes in block 1" block title?

mari3.14’s picture

I 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.

amogiz’s picture

Sorry but i did not find the code you mentioned in the node.tpl.php …

mari3.14’s picture

Oh, 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.

mari3.14’s picture

Or 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.

sokrplare’s picture