Password input leading to specific page

Hi,
I’m a photographer. Currently I have a password protected page that is my client’s dashboard to download their photo’s from via Wix Photo Albums. It looks like this.


Two questions:

1. To acces this page, my client clicks on Login from my homepage and enters the password.
Now, as I get more clients, I would like to reproduce this page for different clients and set different passwords for them. So what I’m searching for is some kind of button that redirects to a specific page, depending on the given password.

2. The Wix Photo Album overview I use in the bottom of my clients dashboard displays all of the albums. For now thats not a problem because there is only one dashboard. But in the case of multiple dashboards, I’m looking for a way to hide certain albums for different clients.

I have looked into using Wix Database for this, but that way I can’t implement Wix Photo Albums. Really looking forward to a solution for this! My skills in code are very limited.

1 Like

@rmjven

There is a simple solution for this if you don’t mind the manual work. What you can do is the following:

Create new pages, but give them a unique name, something like ‘alb-533igh’ and make sure the SEO url is the same. Then you can use this as the unique code users need to enter.

What you can then do is add an input box where users can enter their code, add a button with an onClick handler, and under the buttons’ code add the following code:

import wixLocation from 'wix-location'; // add this code to the top of your page 

export function button1_click(event, $w) {
//add this code below the button
wixLocation.to("/${$w("#input1").value});
}

Good luck!
Tiaan

1 Like

@tiaan
Thanks so much for the reply! It sounds very simple! Yet, being an absolute total rookie, I can’t figure it out. The past 2 hours I spend trying to implement the code, zero result.

I got the new page (name: cohesiefoto). Then I added the onClick handler button and the input box. I placed those on my homepage. And then I placed the code where I think it should be. And then I guess I need to write in the name of the new page somewhere along the code, but where? :sweat_smile:

This is what I got so far: (I don’t know what lines 4 till 7 are)

@rmjven

My apologies, I see I overlooked some parentheses. Please change out the below inside your button…
Also, if you update ‘input1’ to your input’s ID, it should work…

wixLocation.to(`/${$w("#input1").value}`);

Then, when you create a new page, give that page the unique name and the SEO URL should simply have the same name, but just to make sure you get the right code, click on the page icon to the left that opens the pages menu, then click on the small 3 dots to the right, then on SEO, then scroll down to where you see the SEO extension, this will be the code that you need to put into the box in order to navigate to the page (the unique code that you will give to the user)

See the attached image where it says ‘home’ - this is where you will find the unique code

It worked! :grinning: Thanks!
And as far of the Wix Photo Album on the different pages matter, would you by any chance know a solution to hiding/displaying certain albums on certain pages of the client showcase?

Awesome stuff :slight_smile:

Sure. How should it ideally work?

So ideally on each client dashboard page, I use the Wix Photo Album client showcase so that the clients have an overview of all their personal albums. But now, every album I upload in Wix Photo Album are visible in the showcase. Each client should see only their own albums. :slight_smile:

Hmm, it doesn’t look like it…, but what you can do is use any one of the WiX galleries on the page, then create a database, upload all your images up there and give them the same name us the URL code.

Then with a bit of code, you can populate the gallery dynamically to show only photo’s relevant to that URL