Score:0

How to get current region or current block of node in hook_theme_suggestions_node()

ru flag

I need to get the current region or the current block where a node is rendered, in hook_theme_suggestions_node().

function mymodule_theme_suggestions_node(array $variables) {
  $node_region = "I don't know how to get it";
  $node_block = "I don't know how to get it";
  $suggestions[] = 'node__' . $node_region . '__' . $node_block;    
}

I need only one value between $node_region and $node_block. How can I obtain them?

Score:0
fr flag

If you want a node to display differently on different parts of the page, the way to do that is to use View modes.

Drazen avatar
ru flag
Thank you. Solution is to put teaser node in Entity view (Content) block from Chaos Tools module. After that I have separated two nods on page teaser and full.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.