I have coded a function that queries Members/PublicData to find its owners slug before changing linking text to that persons profile using that slug (rather then ID for a neat url).
wixData.query("Members/PublicData").eq("_id", wixUsers.currentUser.id).find().then(res=>{
var txthtml = $w('#txtName').html;
$w('#txtName').html = "<a href='https://www.mysite/profile/"+res.items[0].slug+"/profile' target'_blank'>"+txthtml+"</a>";
});
I noticed just now that this doesnt work for all of my members, so i looked into it and found out that not everyone has a PublicData entry.
My questions are:
When is a PublicData entry made?
Are there any restrictions to accounts that stop them from having PublicData?
Is there a way for a PublicData entry for a member to be manually made?
Thanks.