We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Glide Tag Help

Kelly July 21, 2021 by Kelly

In the following block of code, I'm trying to add the focal-point settings with Glide. I've tried many, many different code combinations of adding glide and nothing is working. Any suggestions?

<div class="hidden md:block md:w-1/2 px-4">
                        class="h-full w-full bg-cover rounded shadow-md"
                        style="background-image: url('{{ image_gallery }}{{ if first }}{{ image_gallery:0 }} {{ /if }}{{/image_gallery}}')"

Ideas such as: 1) Wrapping the div in a glide:batch tag. {{ glide:batch width="600" height="400" fit="crop_focal"}}

2) {{glide:image_gallery:0}} breaks and shows nothing.

The goal is to display the first image of several and that the fit is cropped by the focal point. I'm unsure how to update the background image src when there are several assets and declare glide.

Thanks in advance.

>>>>>>> Unanswered <<<<<<<
3 Replies