Question:
[What code and setup do I need to let my members view other members profile page if you are using a custom profile page? (no app)]
Product:
[I use Wix Editor.]
What are you trying to achieve:
[With a click on a members profile picture the clicking member shall be relocated to the picture-owners profile page.]
What have you already tried:
[I have tried with this code and lots of other codes but the only result I get is that the clicking member is relocated to his own profile page:]
let selectedMemberId;
$w.onReady(async function () {
$w('#repeater1').onItemReady(($item, itemData, index) => {
$item('#image51').link = itemData.memberReference.picture;
selectedMemberId = itemData.currentUserId;
$item('#image51').link = `/members/profile/public/${selectedMemberId}`;
});
wixData
.query('Inclusivecomments')
.include('Members', '_id')
.find()
.then((results) => {
if (results.totalCount > 0) {
$w('#repeater1').data = results.items;
console.log(results.items);
}
})
.catch((error) => {
console.error(error);
});
});
$w('#image51').onClick((event) => {
console.log(selectedMemberId);
});
That makes sense because that is what the link is being set to.
Wix Members doesn’t have a notion of a user directory or public-by-default profiles. Profiles are private by default and users have the option of individually choosing if their profile is made public. You can read more about these options here: Site Members: Making a Member Profile Public | Help Center | Wix.com
Thanks anthony but I have already read the page you linked to and it does not show the code I need to make them able to visit each others profile page. So how can I make my members visit each others profile page if I set them all to automatically become public already when they register to my site?
I use a 100 % custom profile page and not the default or “Members Area” app so thefore I guess that it´s possible to make the public status to default?
For me and probably for the majority this is a very desired feature that really would be appreciated. You should make it easy for site owners to make their members able to visit each others profile page without having to use extremely advanced coding.
Doing this without code isn’t currently possible. You can request it here though: Product Roadmap
To make a member’s profile with Velo you can use makeProfilePublic - Velo API Reference - Wix.com and have it execute when the user registers. There’s also a backend equivalent version of this function that could be used inside something like the onMemberCreated event: onMemberCreated - Velo API Reference - Wix.com
Do note though that you should make it very clear to users who join your site that their profiles are public by default.
Okay, thanks for your kind answers. I will try this out but even if I succede I still gonna need some sort of coding to make members relocate to other members profile pages. That will be the hardest part because I have never seen instructions of how to do it.
The PublicData
collection contains a field called slug
that can be used to create URLs for users: https://www.wix.com/velo/reference/wix-members-backend/"publicdata"-collection-fields
You can use this slug to construct URLs to your user’s profile pages.
Is it really impossible to make your member profiles public if you use a custom setup? I know that it works with a “Members Area” but I don´t like that form of signup or login but at the same time that and the default option seem to be the only ways you can make your member profiles public. That´s really strange and bad for Wix so late as 2024. Do your experts lack enought knowledge or why can you not create a simple solution for this?
In desperation I finally installed “Members Area” again in hope of getting the possibility of mixing it with my custom pages but it didn´t work so now I am out of hope
If you’re just using custom pages and not Wix Members then every page can have its permissions set however you’d like: Studio Editor: Editing Permissions Per Page | Help Center | Wix.com
If you need a page for each member then Dynamic Pages can read from a Collection and do that but you’d need to code the business logic for producing the Collection in Velo.
I´m still waiting for your answer Anthony.
Will you please answer this Anthony:
I have set the dynamic page for profiles to be viewed by all members so that isn´t the problem.
The problem is that I can´t change the members from private to public in my “FullData” collection (which is where the privacyStatus is collected) and I don´t know how to set them as public in my custom collection either.
Can you also please show how to use the slug in the publicData collection to construct URLs to my members profile pages? I can tell you that the only member who is added to that collection is myself and you are not allowed to add them manually