Thank you so much for this module!!! I have am using Paragraphs and the Block Field module to layout out different blocks. The block class module was not providing me with the class when using the Block field module. So This module solved a major issue for me !!!

What would be an awesome addition to this module would be to add the Block Type in the template suggestions. I am adding it in my customtheme.theme file but it would be great if you offered this out of the box.

Why add. For example, I may want to use the same template for all XYZ blocks. Then I may want to use the template suggestions to {%extends%} the base template type. This way I can follow best practices.

Kudos again!

Comments

kclarkson created an issue. See original summary.

miteshmap’s picture

@kclarkson Glad to hear that you find the module helpful. Thanks for the feature request, that's a nice idea! I'll definitely look into this. :-)

miteshmap’s picture

Status: Active » Needs review
StatusFileSize
new1.06 KB

Status: Needs review » Needs work

The last submitted patch, 3: block-type-bundle-tempalate-suggestions-3.patch, failed testing. View results

  • miteshmap committed 4f6415d on 8.x-1.x
    Issue #3023718 by miteshmap: Addition of Block Type to Template...
kclarkson’s picture

@miteshmap,

did it work well for you?

miteshmap’s picture

yes, @kclarkson worked well for me. have you tried?

miteshmap’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

kclarkson’s picture

StatusFileSize
new932 bytes

@miteshmap,

Thanks adding the block theme suggestions in. Super cool module!

I noticed a couple of little things but wasn't sure if you were doing it on purpose. For me the -- at the end right before .html drive me crazy and I notice a little redundancy with adding the * block--block-content--.html.twig again. I attached a patch that changes it up a bit.

CURRENT SUGGESTIONS - FROM

<!-- FILE NAME SUGGESTIONS:
   * block--block-content--instruction-blocks--.html.twig
   * block--block-content--.html.twig
   * block--block-content--cebe0eea-35da-4b96-8300-4347ccd754ad.html.twig
   * block--block-content.html.twig
   * block--block-content.html.twig
   x block.html.twig
-->

NEW ONES - TO

<!-- FILE NAME SUGGESTIONS:
   * block--block-content--instruction-blocks.html.twig
   * block--block-content--cebe0eea-35da-4b96-8300-4347ccd754ad.html.twig
   * block--block-content.html.twig
   * block--block-content.html.twig
   x block.html.twig
-->