Block id is removed in the block component

Created on 19 February 2020, almost 5 years ago
Updated 21 June 2024, 6 months ago

Some modules like facets use the block id for functionality.
By overwriting the block id facets no longer works. This should be default by the next release.

πŸ› Bug report
Status

Closed: outdated

Version

4.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands tim_dj Netherlands

Live updates comments and jobs are added and updated live.
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.

  • πŸ‡¦πŸ‡ΊAustralia elgandoz Canberra

    The above example is almost right but there's a typo. It should be:
    plugin_id ? 'block--' ~ plugin_id|replace({"_": "-", ":": "--"})|clean_class,
    This should really be fixed in the main theme since all the layout builder blocks do not print any class.

  • πŸ‡ΊπŸ‡ΈUnited States devkinetic
  • πŸ‡©πŸ‡ͺGermany marcoka

    Update with drupal 10.2 and Radix 5.0.11

    This code will ad all classes in a second class tag.

    {% if html_tag %}
      <{{ html_tag }}{{ attributes|without('id').addClass(classes)}}{{ attributes.setAttribute('id', clean_id) }}>
    {% endif %}
    

    Correct code:

    {% if html_tag %}
      <{{ html_tag }} {{ attributes|without('id').addClass(classes).setAttribute('id', clean_id) }}>
    {% endif %}
    
  • Status changed to Closed: outdated 6 months ago
  • No longer supported/outdated, closing - feel free to open MR.

Production build 0.71.5 2024