I think the member profile page URLs are automatically named according to the member slug, and slugs are received as part of the email before the @ symbol. But I want to set this according to member usernames, not email. I couldn’t find a way to edit and automate the member database. So I thought maybe this could be done using Corvid. The only thing I want is that the member emails are not public in the URL to other members.
Automatically equal the member slug to the username during signup, does it work for me and how can I do that? or something else to do what I want? Thanks.
Now: Wix has fix the issue so user can change their URL on Members page > My Account
Hi, recently I found that the url is not editable on some sites(and my clients), it should be able to edit in the member page(setting or profile), so I am using coding https://www.wix.com/corvid/reference/wix-users-backend/updateuserfields
Please code a page that connected to table and update on click for old members. Example: (I replace the slug(email) to ID generated by wix)
import {updateUserFields} from 'backend/forum'
$w.onReady(function () {
$w("#table1").onRowSelect( (event) => {
console.log(event.rowData._id);
updateUserFields(event.rowData._id, event.rowData._id)
} );
});
the forum.jsw:
import { badges } from 'wix-users-backend';
import wixUsersBackend from 'wix-users-backend';
export function updateUserFields(userId, r) {
wixUsersBackend.updateUserFields(userId, {
"slug": r
})
.then(() => {
return true
})
.catch((err) => {
return false
});
}
Copy and paste wont help, please try to do edits base on your needs
You can add the event in forum.jsw to Member/PrivateData… (the database that store all the data of member) when the database have a new item(new user
https://www.wix.com/velo/forum/community-discussion/get-current-user-s-first-name
I looked at this page, and will something work like this?
import wixUsersBackend from 'wix-users-backend';
wixData.query("Members/PrivateMembersData")
.eq("_id", wixUsers.currentUser.id)
.find()
.then( (results) => {
Name = results.items[0].name;
} );
wixUsersBackend.updateUserFields(userId, {
"slug": Name
})
Maybe I can run this code automatically when users first register.
I didn’t understand everything in the code you wrote. I just hope this works too. seems logically correct. I hope there is nothing I missed
Thanks so much, you helped me a lot
@gamemakerturkiye
import wixUsersBackend from 'wix-users-backend';
let Name //ADD THIS!!!!!!!!!!!!!!!!!!
wixData.query("Members/PrivateMembersData")
.eq("_id", wixUsers.currentUser.id)
.find()
.then( (results) => {
Name = results.items[0].name;
} );
wixUsersBackend.updateUserFields(userId, {
"slug": Name //Correct, now the name of user = the slug
})
Note: If the user is register using Wix given pop up(not google/facebook), it only collect email and password.
In this case, the code wont work. (because no name collected)
You are advised to generate a random slug(just like the google play card). So it can work every time.
wixUsersBackend.updateUserFields(userId, {
let grup= "";
for (var i = 0; i < 8; i++) {
let text = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
number = Math.floor((Math.random() * 62) + 1);
grup =grup + text.charAt(number)
}
"slug": grup
})
Hi…
Sorry to ask, but which page that I should set the code? member page/my account. or member sign up form ?
Thanks,
Felicia
@certified-code Hi there, could you highlight the areas that I need to change? This is the last bit of info I need a website. Also, Do I put this into the profile page or the sign up menu page?
Thanks
Was this ever resolved? Thank you.
Hey everyone, thanks for your feedback.
Removed: We will keep you posted. (YouTube tutorial coming soon)
This feature is given natively on Wix Members > Account - Editor X
This feature is given natively on Wix Members > Account - Wix Editor
If you still experiencing issue on finding this settings, please contact Wix Support. In the past, there is some issues (?) that made user cannot change their own URL
Hi @certified-code , I have asked a question like this one at the link
www.wix com/velo/forum/coding-with-velo/how-to-change-the-url-in-members-profile-from-username-slug-to-id-on-sign-up\
I was wondering if this would be answered on the youtube video as well? And whether or not there would be a time frame on that video? (not rushing just curious as was going to launch next week but may delay depending on this youtube video)
Thanks for answering to our questions! Really helpful
@jordancookenz I see, so we will post the youtube video today
@certified-code You are Legend.