Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted March 24, 20168 yr Need to add a new field on "Complete Registration" form but I can't: /* Build the form */ $form = new \IPS\Helpers\Form( 'form', 'register_button' ); if( !\IPS\Member::loggedIn()->real_name OR \IPS\Member::loggedIn()->name === \IPS\Member::loggedIn()->language()->get('guest') ) { $form->add( new \IPS\Helpers\Form\Text( 'username', NULL, TRUE, array( 'accountUsername' => \IPS\Member::loggedIn() ) ) ); } if( !\IPS\Member::loggedIn()->email ) { $form->add( new \IPS\Helpers\Form\Email( 'email_address', NULL, TRUE, array( 'accountEmail' => TRUE ) ) ); } $form->addButton( 'cancel', 'link', \IPS\Http\Url::internal( 'app=core&module=system&controller=register&do=cancel', 'front', 'register' )->csrf() ); \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->completeProfile( $form );
March 24, 20168 yr You can. \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->completeProfile( $form ); You got lucky! The form is being passed in as an object instead of as (string)$form. Do a theme hook on front:system, then in PHP mode, overload the completeProfile method. You should be able to make changes to the form in there, then call the parent.
Archived
This topic is now archived and is closed to further replies.