Button Click Events Not Working in login.tpl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lj4353
    Senior Member
    • Nov 2023
    • 134

    Button Click Events Not Working in login.tpl

    Button Click Events Not Working: The social login button is visible but does not respond to clicks.

    Click image for larger version

Name:	image.png
Views:	48
Size:	35.8 KB
ID:	115655
    Attached Files
  • lazovic
    Super Moderator
    • Jan 2022
    • 895

    #2
    Hi lj4353,

    Usually, you can find the cause of errors if some frontend element does not work when clicked in the browser console by pressing the F12 key. You can try it and check if anything is displayed there.

    Comment

    • Kharg
      Senior Member
      • Jun 2021
      • 449

      #3
      I think that the issue is that you are applying the EventListener inside the template file.

      you have to use them in the login.js together with the rest of the scripts you put in the login.tpl

      Comment


      • lj4353
        lj4353 commented
        Editing a comment
        since login.js is not working, I tried adding an EventListener directly in login.tpl.
        The login.js file was not loaded.I’m not sure where the issue is.
        Last edited by lj4353; 03-06-2025, 01:35 AM.
    • lj4353
      Senior Member
      • Nov 2023
      • 134

      #4
      lazovic

      After clicking the button, no logs are displayed. It seems that the button is not being properly listened to.

      client\res\templates\login.tpl
      client\src\views\login.js

      Click image for larger version

Name:	image.png
Views:	33
Size:	56.4 KB
ID:	115670

      Comment

      • Kharg
        Senior Member
        • Jun 2021
        • 449

        #5
        Are you directly replacing the core files in Espo or properly extending using a custom module?

        Comment


        • lj4353
          lj4353 commented
          Editing a comment
          The file client\src\views\login.js is my custom implementation, but it was not loaded successfully.
          The file client\res\templates\login.tpl is the original official template.
      • Kharg
        Senior Member
        • Jun 2021
        • 449

        #6
        You must extend the metadata and add a custom login view
        you can’t edit core files because they are now bundled.
        you have to define a custom view like this:

        HTML Code:
        {
            "loginView": "custom-login:views/login"
        }
        In this custom view you have to point it to use your template.

        I suggest you take a look at my extension if you want to learn more: https://github.com/Kharg/custom-login/
        Last edited by Kharg; 03-06-2025, 02:06 PM.

        Comment

        Working...