ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Can we set background image for Login and Home Pages?


#1

Hi,

I’m trying to set background image for Login and Home Pages by using Website Settings and Web Theme things. But background image not reflecting.

Any suggestions?

Thanks
Raghu.


#2

Hi @raghu561,

as far as I know, there is no “official” answer. And this is more of a hack rather than a solution. But have you tried to set this using the website script? I.e. check if the url contains /login#login, if it does, switch the background of the div.container. Something like

var container = document.getElementsByClassName("container");
if (container.length > 0) {
    if (window.location.hostname.includes("/login#login")) {
       container[0].style.backgroundColor = "#d68080";
    }
}

Hope this helps.


#3

Thanks for suggestions @lasalesi
div.container not available in login!


#4

It should be available:

Maybe you experience a race condition? Try waiting in you script before you load the element (see setTimeout())…


#5

Hi @lasalesi

I did changes over login.css file, now background image working properly.
Thanks for your support!!