Añadir etiqueta de imagen usando api.onToolbarCreate

If I have this in my api.onToolbarCreate:

perform: (e) => {
  e.applySurround(
    `[wrap="Carousel" autoplay=${settings.autoplay}]\n`,
    "\n[/wrap]",
    "image_carousel_placeholder"
  );
}

And my image_carousel_placeholder setting is as such:

image_carousel_placeholder:
  type: upload
  default: "placeholder_image"

It adds the image url of the image, not the <img> tag or the markdown ![] equivalent. How do I go about doing this? I’m trying to avoid the option of the setting as a string to input an actual <img> tag. Is this possible?

Silly me. I completely missed the I18n.translations[currentLocale].js.composer.image_carousel_placeholder line above that.
Now:

I18n.translations[currentLocale].js.composer.image_carousel_placeholder = `<img src="${settings.image_carousel_placeholder}" height="200" width="300" />`;

That works much better.

1 me gusta