236
Views
2
Comments
Solved
setting a background on a cardsimpleImage widget
Question

Team, I'm using the "CardSimpleIamge" widget in a Carousel.  It works perfectly but I can't seem to set the back ground image.... Any ideas ? 

2020-02-28 09-46-54
Eduardo Jauch
Solution

Hi Alex,

This documentation is for version 9.0, but it will work on version 10 also, being the "traditional" way for setting a background image on a widget. 

If you need to set a "dynamic" background image, with image from database, you can do this converting the image (binary like PNG) to base64 (a string), and dynamically set the image using the content directly like this:

"background-image: url('data:image/png;base64," + base64Image + "');"

Hope this helps.

Cheers,
Eduardo Jauch

UserImage.jpg
Alex Fry

Thanks Eduardo,

You pointed me in the right direction. By adding a .cardSimpleImage{...} class I was able to set the background element.  It allowed me to use a straight file reference as well as a database encoded option as you suggested..


Thanks :)


Eduardo Jauch wrote:

Hi Alex,

This documentation is for version 9.0, but it will work on version 10 also, being the "traditional" way for setting a background image on a widget. 

If you need to set a "dynamic" background image, with image from database, you can do this converting the image (binary like PNG) to base64 (a string), and dynamically set the image using the content directly like this:

"background-image: url('data:image/png;base64," + base64Image + "');"

Hope this helps.

Cheers,
Eduardo Jauch



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.