Hi there!
I am working with a database where every item is a member and every dynamic page is their profile. I need to confirm if the logged in user is the owner of that profile. In other words every member is an item and has an _id field i want to see if that id of the page matches the current logged in users id so i can set functions to hide and show the update - share etc buttons.
How can i achieve this
How can i possibly see “if dynamicpage id equals to loggedinusers id” ?
Thank you!
Hi,
You can get the current user ID by calling currentUser()
https://www.wix.com/code/reference/wix-users.html#currentUser
To get the current dynamic page id, use wix-location
If the two are identical, it means that the owner is currently viewing his own page.
Hey Ido Inbar thank you for the answer i’ve been checking these for days yet i couldn’t get any result. Can you show me a working example code for setting an if condition for these 2 (dynamic page id and current user)
Right now i can get both and even to display it on the page but i just couldn’t create an if condition between these 2 -.-