Grab first Image from the gallery-Modul, LIMIT 1

Hi, i try to grab the first image from a gallery-modul with getResource.

Into the documentation i found this, but i think its only for the image-modul, not for the gallery-modul
https://www.modmore.com/contentblocks/tips-tricks/grabbing-the-first-image/

How does its work with the gallery modul? Have you some tips for me?

Greetings Chris

Hi @visions! You can use the cbGetFieldContent snippet to get the full gallery, and then use &returnAsJSON and a custom snippet to only get the first image. Please see the last example here: https://www.modmore.com/contentblocks/snippets/cbgetfieldcontent/#jump_return_json_for_further_processing

Thanks, it works. :slight_smile: