Configurable BackGround

0
Hello, I need to make a configurable background (admin chooses his required background), but the background is a class made by sass! any idea?
asked
1 answers
0

Wow, where to start :) Let me try my best here,

1. Create an entity to allow admin to config and create pages for the same.

  1. Calculated attribute MF for Background URL → expression $AppURL+'/file?guid='+$GUID+'&changedDate='+dateTimeToEpoch($BackgroundConfig/changedDate)+'&'+'name='+$BackgroundConfig/Name
  2. 3. Download Javascript snippet from Appstore by Incentro and model a snippet as such
  1. Configure a variable in JS Snippet like below

 

JS Code for your reference:


var a = document.getElementsByClassName('region-content');
a[0].style.backgroundImage="url(${ImageURL})";

Let me know if this helps, worked for me atleast when tried. Good Luck.

answered