patdec Posted June 11, 2018 Share Posted June 11, 2018 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 More sharing options...
theodiablo Posted September 26, 2020 Share Posted September 26, 2020 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now