Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294447

Layout section and component information accessible during render process

$
0
0

Problem/Motivation

My scenario involves the placement of a views block in layout builder for a content type. During the rendering process, section and section component information is not available once the views block build method is called. I need the ability to inject the section layout ID and the component region values into the views result row/item before it reaches an implementation of hook_preprocess_node().

Proposed resolution

After much digging, I found the SECTION_COMPONENT_BUILD_RENDER_ARRAY event. Using that event and a new one for SECTION_BUILD_RENDER_ARRAY, an event listener can be used to store the information needed in a tempstore that can be accessed in the implementation of hook_preprocess_node().


Viewing all articles
Browse latest Browse all 294447

Trending Articles