Jump to content

Recommended Posts

Posted

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

Posted

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
}

 

  • Like 1
Posted

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.

  • Like 4
  • Thanks 1
Posted
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.

  • Like 1
Posted

@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.

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...