Streaming live at 10am (PST)

Is it possible to have different password backgrounds for different folders needing a password?

Hi,

Is it possible to customise the design of multiple pages that you wish to password protect? I have 2 password protected folders in the same website. At the minute each has the same customised background. Ideally I would like to create different backgrounds for each of these password protected folders.

All help welcome.

Many thanks

Matt


Since only one password utility page exists in Webflow there is no way to change the design of the page without using custom code. It is possible to do by getting the current URI (location.pathname) and then based on that (if or switch statement) change the styling of the page by adding a class to the body or an additional class to the div with the class .utility-page-wrap or add inline styles to an element in your custom code.

Hi,

Thanks for replying. I think I understand the gist of what you’re saying, I’ll have a go and see if I can get to work. For example: If pageurl = www.xxxxx/xxx.com then background-color #1234"? Along these lines?

Many thanks

Matt

Yes. Here is an example;

const   thisPage = location.pathname;
switch (thisPage) {
    case "/slug1":
        $('.utility-page-wrap').addClass("some-class");
        break;
    case "/slug2":
        $('.utility-page-wrap').addClass("some-other-class");
        break;
    default:

        break;
}

Thanks for the example code, much appreciated, would have taken me some time to arrive at that point.

I’ll keep you posted, hopefully will have working a little later.

Many thanks

Matt