Comment to 'Form Templates (custom classes for inputs)'
  • Hello bpmct !

    The best way to detect what method from what file is used for the drawing of the block is the next (Developer app should be installed):

    1) Go to Studio->Developer->Pages->System->Log in(2) area.

    2) Click on "Log in with Sign up link" title.

    3) I the appeared popup, look on the "Content" field content:

    array (

      'module' => 'system',

      'method' => 'login_form',

      'class' => 'TemplServiceLogin',

    )

    It means that this block is drawn by the method serviceLoginForm from the template class TemplServiceLogin. 

    4) If you use Protean template for example then go to folder modules\boonex\protean\data\template\system\scripts\

    5) Find there the file BxTemplServiceLogin.php and open it.

    6) It has the following code:

    class BxTemplServiceLogin extends BxBaseServiceLogin

    {

        public function __construct()

        {

            parent::__construct();

        }

    }

    It means you need to check also the base template file template\scripts\BxBaseServiceLogin.php, the method serviceLoginForm has been declared there. But you may to redeclare it in BxTemplServiceLogin. But notice that the changes in any standard module files may block the automatic updates. So it's better to write your own modules https://github.com/unaio/una-vendor-test/wiki

    • Thanks for the help! I am doing it in my own module so it won't block any updates :)

      One more question - Inside serviceLoginForm, it looks like most of the code I want to modify comes from: 

      $sFormCode = $oForm->getCode();

      ($oForm is this: $oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login');)

      Which seems to be the default way code is generated for any form. If I want to generate the elements differently for the login form, how can I do that?

      • You can do it via Studio->Forms app in the first zoom. No need to change smth in the form classes. Also, look at this manual forms here https://github.com/unaio/una/wiki/Dev-Forms