πŸ‡ΊπŸ‡ΈUnited States @wesleymusgrove

Account created on 23 August 2013, almost 11 years ago
#

Recent comments

πŸ‡ΊπŸ‡ΈUnited States wesleymusgrove

Hi @ndewhurst

I wanted to provide an update based on what one of my colleagues is experiencing. It seems like the `drupal_image` Twig Tweak function does not support the `bf://uri-to-bf-image` protocol and only allows images to load from `public://uri-to-sites-default-files-image`. This might be related to an existing issue where stream wrappers are needed to load any image outside of the normal `public://` directory?

See:
https://www.drupal.org/forum/support/module-development-and-code-questio... β†’
https://www.drupal.org/project/drupal/issues/1308152 ✨ Add stream wrappers to access extension files Needs work

However, if we use the file id `fid` of the mirrored Drupal entity Brandfolder image reference, `drupal_image` is able to load that. In tandem with responsive images, this creates a picture tag with a bunch of responsive options for the image size.

Because of this, we are thinking we'll likely need to create some sort of twig function or preprocess hook that takes a Brandfolder asset id and turns it into an entity id.

It's either that or we try to use the Imagecache External β†’ Twig filter function to load the absolute URLs of Brandfolder images from the CDN link.

I'm interested in your thoughts on that approach and what the pros/cons are of not using the `bf://uri-to-bf-image` protocol?

Thanks!

πŸ‡ΊπŸ‡ΈUnited States wesleymusgrove

Hi @ndewhurst,

Thanks for the quick response and helpful tips!

Related to @cbrand02's questions, I'm looking at this article https://medium.com/geekculture/responsive-image-optimization-with-media-... and am curious if you could provide any feedback on how the Brandfolder module could be used in conjunction with the Easy Responsive Images β†’ module regarding defining and using a set of responsive image styles defined in Drupal?

Also if we're rendering Brandfolder images in our own custom twig templates, how do you recommend that be integrated with Twig Tweak β†’ and the ability to specify attributes that control whether the image is lazy loaded or eagerly preloaded ✨ Add lazy loading example in Cheat Sheet Fixed , i.e. for important images that need priority for Google Core Web vitals and Largest Contentful Paint reasons?

Thanks!
Wesley

Production build 0.69.0 2024