Skip to content

Instantly share code, notes, and snippets.

@zarathustra323
Created December 5, 2019 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zarathustra323/b2e39e279038069ef657abf485d61655 to your computer and use it in GitHub Desktop.
Save zarathustra323/b2e39e279038069ef657abf485d61655 to your computer and use it in GitHub Desktop.
<!-- In the welcome ad template, replace this block of code... -->
<script>
var bgImagepath = window.location.protocol + "//" + window.location.hostname + "/sites/all/themes/penton_core_theme/images/ContentPillar_Welcome_1200.png";
document.querySelector('#overlay-%%CACHEBUSTER%%').style.backgroundImage = 'url('+bgImagepath+')';
var lpath1 = parent.document.getElementById("wl_flogop_div").innerHTML;
console.log('logo_path->' + lpath1);
document.querySelector('#white_logo-%%CACHEBUSTER%% > img').src = lpath1;
</script>
<!-- With this block of code... -->
<script>
var bgElement = parent.document.querySelector('[data-interstitial-prop="bg-url"]');
var bgImageUrl = bgElement ? bgElement.getAttribute('data-interstitial-value') : null;
if (bgImageUrl) document.querySelector('#overlay-%%CACHEBUSTER%%').style.backgroundImage = 'url('+bgImageUrl+')';
var logoElement = parent.document.querySelector('[data-interstitial-prop="logo-url"]');
var logoImageUrl = logoElement ? logoElement.getAttribute('data-interstitial-value') : null;
if (logoImageUrl) document.querySelector('#white_logo-%%CACHEBUSTER%% > img').src = logoImageUrl;
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment