unlcms / project-herbie

Drupal 10 implementation at the University of Nebraska–Lincoln
https://cms.unl.edu
GNU General Public License v2.0
5 stars 6 forks source link

Auto populate Hero block description/label with a default value #86

Closed ericras closed 4 years ago

ericras commented 4 years ago

Basically we want https://www.drupal.org/project/inline_block_title_automatic but not just for inline blocks. We've already added that module for use with Layout Builder: https://github.com/unlcms/project-herbie/pull/90/commits/a26157372c1c68bd9c64a835ef48030bb13c7d91

ericras commented 4 years ago

Going forward with this module (https://www.drupal.org/project/auto_entitylabel) and only enabling any permission at all for just Custom Block entities. Hero labels are managed at /admin/structure/block/block-content/manage/hero/auto-label

I originally envisioned the label being like "Hero for node 84" but that would take some programatic work. Also, I think using something like Hero [block_content:b_hero_title] gives a peak as to whether the optional hero title is set and its value (below). This might also be useful if we want to allow reuse of heros at some point in the future.

Screen Shot 2019-08-23 at 5 05 11 PM
ericras commented 4 years ago

Blocked by #67

ericras commented 4 years ago

I tried to do something here without adding custom code. The reasoning behind Hero [block_content:b_hero_title] was so that if the token is empty (the hero title is optional) then the label would be Hero and wouldn't be blank. Maybe (Hero) [block_content:b_hero_title] or [Hero] [block_content:b_hero_title] would be better?

macburgee1 commented 4 years ago

This looks good. I'm good with either naming convention (parentheses or brackets)

I investigated using Automatic Entity Label to replace Inline Block Title Automatic and posted my results here: Integration with Layout Builder for custom block types. I think we stick with everything as-is.