Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Wolf_22 on
From what I can see in the markup generated by Drupal 8 when looking at blocks I need to style, I'm seeing wonky IDs, especially if I omit titles from the blocks (I think Drupal is falling back on the description to use for the generated ID?).
I shouldn't need to delete an entire block just to change an ID of said block, should I? Is there an easy way to edit block IDs?
Comments
Try 'Block ID' module.
Try 'Block ID' module.
Nice. Thanks!
Nice. Thanks!
class instead of ID
You've got an answer above but FYI, might be better to use Class instead of ID to style. Sometimes blocks get used multiple times on same page. Even if that's not your specific case, it's a good idea to get in the habit. An example would be a site that uses the Search block in header and footer, etc. https://www.drupal.org/project/block_class
Custom block library
Hi, I`m using Custom block library to create my blocks then use panels to build my page.
When I inspect the block, below is what I see. I`ve installed the block_class module.
<section class="block block-block-content block-block-contentbee738de-8675-48f5-9c35-7e7d4a4fe9c1 clearfix">