Hi, I want a button to appear only for the logged-in user on his profile page, if I go to another member profile, I don’t want to see it , but if I come back to my profile as a logged-in user I want to see it. Any ideas…?
Thanks!
Hi, I want a button to appear only for the logged-in user on his profile page, if I go to another member profile, I don’t want to see it , but if I come back to my profile as a logged-in user I want to see it. Any ideas…?
Thanks!
$w.onReady( () => {
if (wixUsers.currentUser.loggedIn){
$w( “#editProfileButton” ).show();
} else {
$w( “#editProfileButton” ).hide();
}
});
Im using this code., but when i go to another member page the button still appears.
Why the button should not appear?
You just ask if the user is logged-in and YES the user IS logged-in —> so the button will be visible on every of your pages.
When you go to another memberpage (the user is still be logged-in, right?)
You will have to differ the URL of member-page.
A URL of MEMBER-PAGE-A will surely be another as URL of MEMBER-PAGE-B.
IF OWNER/USER-ID = xyz ----> then only MEMBER-PAGE-URL—> xyz.url —> can be opened.
Should it be only be visible on one page, then you probably selected show on all pages.
Rightclick the element and down the list is an option “Show on all pages”
Be sure to set it off so it won’t show on all pages
Kind regards,
Kristof.
Excelente! Thanks in going to try something like that. im a begginer but im good jajja im going to do my best jaja thanks!
Kristof, that option maybe would help. The idea is that the button; is an edit profile option, so the logged in member is the only one possible to edit it. And to disable the option and hide it in other member profiles. I dont want to edit other member profiles.
Russian-dima , sounds a good option! Im gonna try it! Thanks!
Give a feedback, when you have solved your problem, or ask for help, if you still need it.
hey , im having the same problem have you solved it???