Jump to content

Override admin login header.tpl

Recommended Posts



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


Share this post

Link to post
Share on other sites

  • 2 years later...

Hi @patdec,


Have you found another solution for this?
I am quite interested too.

I want to avoid editing the core template files as much as possible and I would like to use a module or my own template to override this.

Any idea how we could do this?


Thanks a lot!

Share this post

Link to post
Share on other sites

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More