Problems using 'Rendered entity - Block' in header/footer

Created on 8 September 2015, over 9 years ago
Updated 15 May 2023, almost 2 years ago

Problem/Motivation

Views allows rendering a block in the View header or footer using the 'Global: Rendered entity - Block'

Problem 1: Bad UX

What value to enter in the field 'Block ID'. After a bit of trial and error, I managed to get this working by adding a block to a region, editing the block and getting the ID from the URL.

Problem 2: Dependency on block in region

I've "created" a block ID by placing a blok in a region. But the block ID only exists as long a the the block is configured to be visible in a region. When the block is deleted from the region, the View breaks.

Proposed resolution

  • Make a block selectable via the interface, similar to the selection following 'Place block' on /admin/structure/block.
  • Make rendering a block in the view independent of the block being placed in a region.

Remaining tasks

  • Make a patch
  • Write test

User interface changes

Improved UX by making a block selectable.

API changes

Data model changes

πŸ“Œ Task
Status

Needs work

Version

10.1 ✨

Component
ViewsΒ  β†’

Last updated about 15 hours ago

Created by

πŸ‡³πŸ‡±Netherlands sutharsan

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom natts London

    I'm surprised that neither of these issues, especially the second which is a definite bug, have been addressed in all this time.

    Just to confirm that using the global block area provided by the views_block_area β†’ contributed module worked for me too.

  • πŸ‡ΊπŸ‡ΈUnited States Kurt.j

    For what it's worth, I found this option: "Rendered entity - Block" did not render the block in the view header or footer, but this option: "Rendered entity - Content block" did render the block. Key word being "Content" I guess. I would agree that the difference between these are not evident.

  • πŸ‡ΊπŸ‡ΈUnited States swirt Florida

    I figured out a bit more of this. If I create a block plugin with an ID of 'my_custom_block'
    and I try to use that ID in the header of my View, it is completely missing from the output.

    However if I place the block in a region using the Block Layout admin UI, the block instance is given an ID that looks like 'my_theme_name_mycustomblock' (notice all the underscores removed from my block id) and if I use that ID in the "Rendered entity - Block"
    It will display.

    I can work around getting that on a single site, but I want the View and Block to ship with contrib module and I can not predict the name of the theme that would be used where to fake place this block so it does not show twice.

    This is a core bug that really needs to be solved.

Production build 0.71.5 2024