Image Element and Custom Dynamic Data

The default bricksbuilder image elements accepts dynamic values for the image source. I’m crearing my own dyamic tag to use with this field. But I can’t get it to work.

What type of value should my dynamic tag be returning? The html tag? Id? Array?

you can create a dynamic data that returns an url but you have to write that inside the custom url-field.

if you want to use an id your tag needs to return an array of image(s).

like this:

function get_my_tag_value($tag, $post, $context = 'image') // context image! 
{
  if ($tag !== '{my_dd_tag}') {
    return $tag;
  }

  $value = [1047]; // Array of Image! (For single image)
  $value = [1047, 1035]; // Array of Image-ID(s)!  (For image-gallery)

  return $value;
}