Welcome sosoba!
This would be possible by making a hook to any of the the form building methods in ProcessPageEdit.module. All methods with three underscores are hookable. All about hooks.
Take the HelloWorld.module and add this hook to the init()
$this->addHookAfter('ProcessPageEdit::buildFormSettings', $this, 'buildFormSettings');
And then add this function to the class.
public function buildFormSettings(HookEvent $event){
$fieldset = $event->return; // get the fieldwrapper returned
$field = $fieldset->get("_pw_page_name"); // get the name field
$field->collapsed = Inputfield::collapsedYes;
}
Thanks!
I studied the page you mentioned (didn't know it) and all worked like a charm
With your code the name field was correctly hided in edit page, but also wanted it to be collapsed on page creation.
My solution was to transform the ProcessPageAdd::buildForm() method in a hookable one (___buildForm()) and add
$this->addHookAfter('ProcessPageAdd::buildForm', $this, 'buildFormSettings');
to the init() function you provided.
I know it is inelegant (and probably will create problems during update), but trying to attach the hook to the ProcessPageAdd::execute method, the only one hookable on page creation, was no good