HI,
Using Tiles I have this style_template setup:
style_template: >
if (attributes.unit_of_measurement === 'On') return 'background-color: #e20000;background-image: url(\"' + attributes.entity_picture + '\");--tiles-text-sec-color: #333;font-weight: bold';
return 'background-color: #555B65;background-image: url(\"' + attributes.entity_picture + '\");--tiles-text-sec-color: #fff;font-weight: bold';
As you can see, several options are the same for On and Off (entity_picture, font-weight) while others are not of course. Is it possible to have a template for only the differences and have the common options lifted out of the if then else? something like:
style_template: >
return 'background-image: url(\"' + attributes.entity_picture + '\");font-weight: bold;'
if (attributes.unit_of_measurement === 'On') return 'background-color: #e20000;--tiles-text-sec-color: #333';
return 'background-color: #555B65;--tiles-text-sec-color: #fff';
As it stands, image_template isnt available, otherwise I could have stated that in the entity properties. The other properties are all only set in a style_template, so cant be done in the entity properties either?
Cheers,
Marius