bpmct

Add new...
 
Added a discussion 

Hi,

I am a PHP developer. I am trying to change the appearance of the "Log in" form and would like to add special classes to the inputs. I added the "Login" block to the "Homepage" page and would like to make it appear differently here than on other pages. How can I override the class or apply a different template to this one? I Found `BxBaseServiceLogin.php`, and I know how to override that in my module but it looks like that is not handling the actual HTML code for the form.

Ben

  • 703
    • 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

      💓0 😆0 😲0 😥0 😠0 0
      • Hi Leonid,

        Makes sense. I see that you can edit the input names (and even the input attributes in the SQL database), but I want to give elements in the login form different CSS classes from how normal forms are generated. For example:

        normal form input: <input type="text" name="ID" class="bx-def-font-inputs bx-form-input-text" autocomplete="off">


        input in the login form: <input type="text" name="ID" class="special-login-class bx-def-font-inputs bx-form-input-text" autocomplete="off">


        I cannot do that in the Studio Forms editor or even SQL... I know I can change the "attrs" for each input but the classes are handled somewhere else. I was hoping there was a way I could handle form HTML code generation per-form or make a different template that generates different HTML elements. I was close, but then I saw that all of the login form code comes from:

        $sFormCode = $oForm->getCode();

        which is how ANY form gets the code. What am I missing?

        💓0 😆0 😲0 😥0 😠0 0
        • Nevermind, I got it. You can add custom classes to individual inputs with the attrs column in the attrs column of the sys_form_inputs table with a serialized associative array.

          For example:

          UPDATE `sys_form_inputs` SET `attrs` = 'a:1:{s:5:\"class\";s:10:\"ben_did_it\";}' WHERE `sys_form_inputs`.`id` = 3

          Then, just add the SQL code to install.sql and uninstall.sql for your module. Thanks for your help @LeonidS.

          .  

          💓0 😆0 😲0 😥0 😠0 0
          Not logged in users can't 'Comments Post'.
          Achievements

          Ninja

          Total points: 119.5

          330.6 point(s) to reach
          Info
          Friends count:
          Followers count:
          Full Name:
          bpmct
          Membership
          Standard
          bpmct Discussions
          •  ·  703
          •  · 
          Hi,I am a PHP developer. I am trying to change the appearance of the "Log in" form and would like to…
          •  · 
          •  · 
          •  · Nevermind, I got it. You can add custom classes to individual inputs with the attrs column in the at…

          UNA - Network Infrastructure for Communities

          Close