Hello, I’m trying to get cropzoom working on my front page. I have this img tag that brings me the image of the respective blog post but I can’t get it to work with cropzoom.
Here it is: <img src="{{ header_image_url }}" width="{{ header_image_width }}" height="{{ header_image_height }}">
and I’m trying to make either of the code below work with it but can’t. The one just below works when used inside the content part of a page.
Thank you. But for this code: {{ page.media['sample-image.jpg'].cropZoom(600,200).html()|raw }}
What is exactly supposed to replace the sample-image.jpg?
I am trying this code for instance and nothing is being rendered on the screen. {{ page.media['https://thumbor.forbes.com/thumbor/fit-in/900x510/https://www.forbes.com/home-improvement/wp-content/uploads/2022/07/download-23.jpg'].cropZoom(600,200).html()|raw }}
I’m struggling to get it working with a regular https://example.jpg to replace the sample-image.jpg but is there a way to use {{ header_image_url }} so that I don’t have to manually choose?
Is filename optional or will it NOT work if there is a FQDN in the path?
@ezpz,
The snippet page.media['sample-image.jpg'] tells Grav to get file sample-image.jpg from the existing set of media files available inside the folder of the page.
Grav won’t download the image pointed at using a url.
Thanks but is there any way to tell that snippet tool to just grab the LEFT MOST image (that sits under the page media like in the screenshot) and use that, without me having to put the actual image filename in that sample-image.jpg place?