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

wombatbuddy’s picture

Try 'Block ID' module.

Wolf_22’s picture

Nice. Thanks!

TimeBandit’s picture

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

JasonLee87’s picture

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">