Public view vs User view for profile pages

How would I go about having a profile page where the current user can have fields and buttons for editing their profile, but all a visitor would see is there completed profile? I imagine it would be similar to how facebook functions with profiles.

You need to define when the specific elements should be visible and when not individually.
In the element editor uncheck the “This element is visible on page load” check box and then in the Conditional Tab of the editor define a condition of when it should be visible. Most likely it would be When Parent group user = Current User. Then in the dropdown select “This element is visible” and check the box. You’ll need to this for each element that requires this and can copy the condition from one and paste to the others, just make sure you uncheck “visible on page load” checkbox on each.

1 Like

Ill give it a go. Thanks!

Also make sure you’ve properly set up your data privacy settings to reflect who you want to see what. They’re essential.

I didnt even know about data privacy settings. Where do I start on that?

What @vini_brito says is true, but first just figure this out. (Hint: do the sending data to a page lesson.) Don’t worry about that (Privacy Rules) right now.

Then, when you have your profile display/edit page working, you’ll notice that everyone can see all the data about every user. You won’t want that when you have real users.

So, what will happen is this:

And then you’ll want to come back here and ask how you stop that from happening. But instead, just read the manual and reference about Privacy Rules (found on the Data tab in your app).

And you can search the forum and read up on that topic as well.

But — until you’re able to make a page that actually displays anything at all — this isn’t an issue, right?

I have the page displaying data from the “edit profile” page, but instead of having an edit page full of inputs, I wanted to have the profile page displayed, but only that profiles owner/user can see the “edit profile photo” button, or any other “update info” buttons.

Try doing as @keith said, do the lesson he mentioned and you’ll be fine.

1 Like

Ive done that lesson, several times lol. This is more of a displaying data to a certain user vs the public than sending the data to a page though, I believe.

OK then. So you understand that the profile page can display any user.

As was explained in a previous comment, you can know when the User displayed in the profile page is the User looking at the page like so:

Current User is Current Page User

… will be true (evaluates to “yes”) when the Current User is looking at their own profile.

So now you just put whatever changes on your page that you want to have accessible to the page’s “owner”. You keep them hidden unless “Current User is Current Page User”.

This is simply the converse of what you’d do with a standard edit page, right? Let’s say you have some thing that the user creates like a Foo (and Foos should only be visible to their creator). You can’t let anybody but the owner/creator of the Foo see the Foo or delete or modify the Foo. So on the edit_foo page, you’d have a condition that says “When Current User is not Current Page Foo’s Creator” and then a workflow step that would bounce them to the index or something.

Now let’s say that in fact Foos aren’t secret and you want anybody to see a Foo (even a user who isn’t logged into or signed up for your site). And you’d like to have everyone see a Foo, but only the Foo’s creator can edit it. And you’d like to just use the same page for displaying and editing Foos.

The data type for this page is now Foo. And you’d just evaluate this expression:

Current User is Current Page Foo's Creator

And when that’s true you’d enable editing features for the page’s Foo.

As you can see, what I just described is EXACTLY what we’re trying to do with our profile page. The only difference is that your profile page is not of type Foo. Your profile page is of type User.

Users do not have a Creator (they are created by the system). So the expression becomes:

Current User is Current Page User

And now we are no longer confused about “Current User” (which is just a metaphor for the entity viewing the page) and “Current Page User” (which we now see is simply the object – in this case of User type – displayed in the page).

1 Like

Man thank you so much for taking the time to type that out! Im going to rebuild my prof page and try to see if I can get it to come out.

1 Like