Making-Websites-With-October-CMS icon indicating copy to clipboard operation
Making-Websites-With-October-CMS copied to clipboard

How to make a user profile public

Open os-kingsley opened this issue 5 years ago • 1 comments

I just watched the video on user and extending user. It's great. I am learning and building at the same time but confused right now about how to make a user's profile accessible by other users. Currently i have this on my profile file

title = "Profile" 
url = "/:id" 
... 
[session] 
==
<?php
function onStart() {
$profile = $this->param('id');
} 
?>
==

It is connected using

<a href ='{{ 'profile'|page ({ id: user.name}) }}>Profile</a>

I can currently display the user' s info using {{ user.name }} or {{ user.phone }} If i logout and try accessing a user's profile it doesn't work and i am at lost how to do it. I will appreciate any help on this. Thanks

os-kingsley avatar Jun 02 '19 20:06 os-kingsley

Try removing [session] from the code. I think you can access users profile only if you are logged in as that user. But I'm not sure.

ivandoric avatar Jun 11 '19 11:06 ivandoric