Drupal 8.2: I have an odd issue. I've created a smart banner block that I want to render at the top of all of my content pages. The banner will change based on the type of the content that I'm rendering. The banner block is a Views Block that queries a standard set of fields and alters its behavior based on the values returned. I have a custom Twig template set to output the results.

This works fine on a regular node. My problem arises when I have a Views Page. I have some dynamic pages on the site that use the same base templating. For the most part, these Views Pages work fine, with one exception, they don't want to render my custom Views Block. I've debugged the preprocessing functions and I can tell that my Views Block is indeed listed in the Render Array for the HTML. However, my custom preprocess function for the Views Block is not called on a Views Page (when stepping through the debugger it IS called when rendering a node).

I'm at a loss. Is it caching? Is it a bug?

When I run Kint() on the region that I'm rendering, I see the following (instead of rendered HTML). Drupal has a placeholder set aside for my custom block. It is being flagged to load via the lazyBuilder (I think this is a BigPipe feature right?), but that is as far as it gets.

<drupal-render-placeholder callback="Drupal\block\BlockViewBuilder::lazyBuilder" arguments="0=views_block__smart_banner_block_1&amp;1=full&amp;2" token="75001751"></drupal-render-placeholder>

Any suggestions or ideas?

Thanks!

Comments