Pip Posted July 11, 2020 Share Posted July 11, 2020 Hi everyone, I'm trying to work on automatically creating a page when a user signs up. Thing is the page created will be automatically assigned to them as the creator. How do I assign it to a different user? Been testing out various codes but it still wont work. Any idea? $memberpage = wire('pages')->add("blank", "/member/", ['title' => $user->name, 'name' => $user->name ]); $memberpage->set("createdUser", wire("users")->get("bobot")); $memberpage->save(); bobot is my user where I would like to set the page creator as. Sorry. Totally new on this. Thank in advance. Link to comment Share on other sites More sharing options...
teppo Posted July 11, 2020 Share Posted July 11, 2020 Check the "Advanced" tab in the Template settings. There you'll find an option to make the createdUser modifiable: Quote When checked, pages using this template will have an option to change the 'created by user' (for superusers only). It will also enable the $page->createdUser or $page->created_users_id fields to be saved via the API. 6 Link to comment Share on other sites More sharing options...
Pip Posted July 11, 2020 Author Share Posted July 11, 2020 9 hours ago, teppo said: Check the "Advanced" tab in the Template settings. There you'll find an option to make the createdUser modifiable: @teppo Dude, this was in my head when it worked. Thank you!!! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now