0

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?

0

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

1
  • 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.
    – Drazen
    Jan 1 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.