ziu Posted November 18, 2017 Share Posted November 18, 2017 hi, just created a parent page and under this i want a user who is logged in to create only one page, not more than that. how can i do this. thanks Link to comment Share on other sites More sharing options...
kongondo Posted November 18, 2017 Share Posted November 18, 2017 You will need to use a hook, maybe in ready.php. Here's some code to get u started (unstested and written in a hurry). // I can't remember if 'child' will get unpublished and/or hidden pages // you might need to perform other checks (user logged in? => $user->isLoggedin()) $usersChildPage = $parentPage->child("created_users_id={$user->id}"); if($usersChildPage && $usersChildPage->id) { // this user already has a child page; do something else } 1 Link to comment Share on other sites More sharing options...
Robin S Posted November 18, 2017 Share Posted November 18, 2017 Another approach is to not allow users to create pages at all, but rather automatically create a single unpublished page for each user in a hook at the time the user is created. Then each user can populate and publish their page if they wish. 4 1 Link to comment Share on other sites More sharing options...
kongondo Posted November 18, 2017 Share Posted November 18, 2017 1 hour ago, Robin S said: Another approach is to not allow users to create pages at all, but rather automatically create a single unpublished page for each user in a hook at the time the user is created. Then each user can populate and publish their page if they wish. Yeah, this approach is better. @ziu There's various examples in the forum regarding Robin's suggested approach. Just can't find them now. 1 Link to comment Share on other sites More sharing options...
ziu Posted November 19, 2017 Author Share Posted November 19, 2017 thanks @Robin S @kongondo , you both are correct. i will create a page when user is created. Thanks will post the update. Link to comment Share on other sites More sharing options...
ziu Posted November 21, 2017 Author Share Posted November 21, 2017 @adrian i am still not able to figure it out, can u tell me how can create a page like 'profile' so that when user who logs in can have this page's shortcut on their screen and can just fill this page. 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