Is there a function to get a field by name, similar to index but applied to structs for example resource.Image
?
I mean something like this:
$image := <get image from resources>
$imageLink := getField $image "Permalink"
This example is trivial, but I have a slice of images I want to convert to a slice of image links and it would be handy to use ´apply´ with that function instead of creating manually the slice. I tried index
but it doesn’t work on structs.
Thanks!