Dynamic setting of container background image - service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2018 07:50 AM
We need to be able to dynamically change the background image set in the container the Homepage search widget resides in on the main landing page of the service portal.
As such we need to be able to get to the container element to set the background image in the link function, and the only way we've been able to find this element is by using the following:
function(scope, element){
var d = $(element).parent().parent().parent().parent().parent().parent().parent()[0];
d.style.backgroundImage = 'url('+scope.data.image+')';
}
However the downside is that if the DOM changes this will fail.
Can anybody recommend a better way of doing this?
$('.cbe98a8d2cb20020000f8d856634c9c63').css("background-image","url('+c.data.image+')"); doesnt work due to JQuery restriction in the portal.
Cheers
- 2,896 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 02:58 AM
Hi All,
Did anyone get anywhere with this?
I have a requirement to change the portal background based on users location or company.
Any advice would be appreciated.
Thanks!
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2024 02:02 AM
Hi All,
I have the same requirement. Does anyone have any solution to this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2024 01:20 PM
I want to learn to do this. Does anybody have a solution?