Custom button to the default login

Hi,

I need to add a pdf download button only visible to members.
If no login then i need a button call “Please login to download”.

Im using the following code to hide and show the relevant button. But i dont know how to redirect the users to login page. Please help.

$w.onReady(function () {
if (wixUsers.currentUser.loggedIn) {
$w('#button7').show();
}
else {
$w('#button7').hide();
}
if (wixUsers.currentUser.loggedIn) {
$w('#button13').hide();
}
else {
$w('#button13').show();
}
});

Cant find the login lightbox to link. it only links to sign up page every time

You should look at using the prompt login function from Wix Users API, where you can use it by itself or you can use it with options for what you want to do and show a certain window only.
https://www.wix.com/corvid/reference/wix-users.html#promptLogin

You can see an example of it being used in a similar tutorial here from Wix for member profile page.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area#code

Hi, I checked and its working find now. thanks alot