#see https://6634ea6cb86b9825df5cb7bb-ktyiefbntg.chromatic.com/?path=/docs/elements-bricks-b-video--docs
# https://gitlab.bgm-gmbh.de/nov/templates/azh/-/blob/main/elements/bricks/b-video/b-video.template.twig

tt_content.b-image =< lib.twigContentElement
tt_content.b-image {
  templateName = elements/bricks/b-image/b-image.template.twig
  dataProcessing {

  }
  variables {
    contentBase < lib.ContentBase
    image {
      html =< lib.contentElement
      html {
        templateRootPaths.10 = EXT:bgm_theme_azh/Resources/Private/Templates/
        partialRootPaths.10 = EXT:bgm_theme_azh/Resources/Private/Partials/
        templateName = B-Image
        dataProcessing {
          10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
          10 {
            references.fieldName = image
            if.isTrue.field = image
          }
        }
      }

      objectFit = cover
      aspectRatio = FILES
      aspectRatio {
        references {
          table = tt_content
          fieldName = image
        }


        maxItems = 1

        renderObj = TEXT
        renderObj {
          data = file:current:crop
          stdWrap.postUserFunc = Bgm\BgmThemeAzh\Utility\ContentBaseUtility->getAspectRatio
          stdWrap.postUserFunc.defaultAspectRatio = {$styles.content.image.defaultAspectRatio}
        }
      }
    }
  }
}
