Jump to content

Override admin login header.tpl


Recommended Posts

Hi,

 

I'm new to Prestashop.

I'm creating a 2FA authentication module for my own needs.  For this, I added a hook on the admin login page.  But it's not enough. I have to override the js/admin/login.js file. This file is loaded in adminxxxxx/themes/default/template/controllers/login/header.tpl.

 

I haven't found a way to override this header.tpl in order to replace the original login.js by my own. If I place  my own in /2famodule/override/controllers/admin/templates/login, it doesn't work.

The only solution I found to load my own login.js  is to replace directly in the original header.tpl the line that loads login,js like below:

<script type="text/javascript" src="../js/admin/login.js?v={$smarty.const._PS_VERSION_|escape:'html':'UTF-8'}"></script>

 

replaced by

 

<script type="text/javascript" src="../modules/2fa/views/js/admin/login_hdl.js?v={$smarty.const._PS_VERSION_|escape:'html':'UTF-8'}"></script>

 

 

It's not really clean....

 

Someone can help me to show me a better way to do this.

 

Thank you

 

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...