How to get field block path in Layout Builder entity view template

Created on 2 December 2019, almost 5 years ago
Updated 12 April 2024, 5 months ago

In hook_entity_view() with simple field template I could do so:

unset($build["field_my"]);

But in Layout Builder I should do something like that:

unset($build["_layout_builder"][1]["first"]["60d766ef-67f2-4a95-8b95-473d5a266feb"]);

And if I move field field block from 'first' to 'second' section, I should edit my source also.

How to get field block path in Layout Builder entity view template?

Something like that:

  public static function getLayoutBuilderField(array &$build, string $entity_type_id, string $bundle, string $field_name) {
    ...
  }
πŸ’¬ Support request
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
Layout builderΒ  β†’

Last updated less than a minute ago

Created by

πŸ‡ΊπŸ‡¦Ukraine super_romeo Kiev

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.

  • πŸ‡³πŸ‡ΏNew Zealand DanielVeza Brisbane, AU

    This has had no further updates for 2+ years, so I'm closing this issue.

    If this is something you're interested in following up on, I recommend writien up a detailed question about what you trying to achieve and using the excellent support page β†’ on Drupal.org to find people who may be able to help

    Thanks for raising an issue!

Production build 0.71.5 2024