Jump to content

Recommended Posts

Posted

I have a page that has a field that contains a page.

How do I use the API to update a page select field in the page's page?

Example:

User page has field "member" which points to a member page.

Member page has field "gender" which points to page for selecting gender.

How do I change the page the gender points to from the user page?

I've tried 

$user->member->gender = 123;

 where 123 is the new page ID.

Also, 

$user->member->set("gender", 123);

Both of these seem not to work.

Posted

As adrian's answer shows you'll need to save the member page, not the user. The user page just holds the reference to the member page, but the fielddata of both pages are fully unrelated to one another.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...