View more context


suppose I can just define everything but that? no?

That just specifies which pages can be children of the current one

I usually use something like

  1. php
  2. public function canCreate($member = null, $context = [])
  3. {
  4. $parent = isset($context['Parent']) ? $context['Parent'] : null;
  5. if (!$parent || !$parent instanceof ProjectHolder) {
  6. return false;
  7. }
  8.  
  9. return parent::canCreate($member, $context);
  10. }

Right I see, brilliant. Thank you 🙂

(obviously replace ProjectHolder with whatever the parent page should be

Yeah, I don’t think the above snippet will stop people moving them into the wrong place after creating