Does anybody know how I can change the body background-image without modifying CSS?

0
Hi I’m new to Mendix and the concept of low-level programming. I’m a first year Computer Science student who is familiar with high-level languages such as: C#, Javascript, Python, REACT, HTML and CSS. I’m just wondering is there a Mendix approved way of changing my app’s background-image without modifying the CSS files directly? Changing the style inside my main.css file is an easy fix – however I also want my background image to be dynamic. For example: If the weather attribute equals: “clouds” I want to automatically update the background image to show clouds, if the weather equals = “rain” I want to use a background image of rain etc. There doesn’t appear to be a way of selecting the entire body inside structure mode –only individual drop zones? Any help is greatly appreciated and invaluable to my learning. Moderator edit: Once again, please don’t use the phrase PLEASE HELP! to start your question. Everyone here has questions and is asking for help.
asked
2 answers
2

You should change the SASS files and not the CSS files.

answered
0

Again, HTMLSnippet, JS mode, something like this

if the contextobj is not null the
    build a file?id url using the guid
    change the attribute style of your body/whatever dom element
else
   log error

or generate and serve up css from a request handler/rest blue block thingy

answered