You have to use the method add_render_attribute
to add this into the backbonejs part i.e. inside the _content_template
:
$this->add_render_attribute( 'image', 'src', $settings['image']['url'] );
add_render_attribute for reference
Once you added the attribute you can access it in _content_template
like this:
settings.image.url
settings.image.url for reference
Therefore, the thing you need to add is add_render_attribute
method inside the method render
to access in _content_template
Mainly focus on this particular snippet of content template method:
var image = {
id: settings.image.id,
url: settings.image.url,
size: settings.thumbnail_size,
dimension: settings.thumbnail_custom_dimension,
model: view.getEditModel()
};
var image_url = elementor.imagesManager.getImageUrl( image );
var imageHtml = '<img src="' + image_url + '" class="elementor-animation-' + settings.hover_animation + '" />';
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…