How to change the URL in members profile from {username}/slug to ID on sign up

So I have added the WIX members area but when I checked the url it is
website .com/profile/{username}/profile

I want this to be website .com/profile/membersID/profile

I have tried inserting this code

into the backend area but nothing seems to have changed. I got this code form this Velo question that is similiar to my own and tried to work with it but am yet to get it working. www.wix .com/velo/forum/coding-with-velo/how-can-i-change-the-member-slug-or-community-page-ur l

Am I missing something? Am i not posting it in the right area? Is the code i have made bad somehow or is there an easier way I have over looked. Thanks for any help you can give me

Hi,

  1. Your code is not so clear. You’re missing import wixData , you’re using wixUsers instead of wixUsersBackend , you don’t export any function . + you’re not return ing anything. And the purpose of the code is not clear either. Maybe you can elaborate about what you’re trying to do with this code.

  2. Changing the page URL should be done via the editor, not by code.

Hi J.D. greatly appreciate your response to my question

  1. It is my first time trying to make the code normally I just copy and paste hence the errors. I am trying to change the {username} section in the members profile page to {membersID}. I believed that ordinarily it was this by default but it is not and there is no way to change this URL for some reason. I have tried everything through the editor but there isn’t an option to do so. So I have reverted to trying to code the process.


So basically as the members create their accounts they are given a members ID in the Privatemembersdata collection. The URL is using the “slug” (the "slug is the information before that @ symbol in the email) section to fill in “{username}” (even though I have a username when the member signs up but this isn’t being used) I don’t want this “slug” to be used though as this is private information to the member and members emails could easily be figured out from this as the profile page will be public.

so I want a unique code (such as the members ID) to be used so that their information is kept private from the public. Also the unique URL has to be consistent, as in it can’t change every time the user logs in, hence why the MembersID would be a perfect fit for this URL. Again no way to do it through wix editor.

Please let me know if this makes sense.

Try {ID}

@jonatandor35 So same code I have above just use {id}?

if you are meaning why not enter the {ID} into the Wix editor instead of the {username} i am unable to change that. All is locked in this section except the profile. that is why it is greyed out and only the last profile is in black


I have honestly tried everything through the editor. And searched any solution but nothing comes up. I don’t know why it has chosen to use the username and not the MembersID. I have seen examples of other peoples web pages placing {membersID} in this section over {username} really doesn’t make sense to me

I have edited the code a little bit. Does it make more sense now?

@jonatandor35 any ideas on what I could do? Or where I could be looking?

I am looking for same solution… hopefully somebody will help us

@jordancookenz I’m missed your question. Is it still relevant?

Looking for this same solution! Can’t get my code to work despite best effort.