30ml Posted September 11, 2013 Share Posted September 11, 2013 hi, I am working on getContent() here, I can include tpl file with this below code. $this->display(__FILE__,'views/templates/admin/subscribecat.tpl') But how can I inset JS file to for that subscribecat.tpl. I need to do some jquery stuff. Thanks !! Link to comment Share on other sites More sharing options...
vekia Posted September 11, 2013 Share Posted September 11, 2013 just insert <script> <script type="text/javascript" src="../js/jquery/this-is-library.js"></script> Link to comment Share on other sites More sharing options...
30ml Posted September 11, 2013 Author Share Posted September 11, 2013 thanks it works Link to comment Share on other sites More sharing options...
vekia Posted September 11, 2013 Share Posted September 11, 2013 im so curious about module that you're creating can you say something more about it? Link to comment Share on other sites More sharing options...
jgullstr Posted September 11, 2013 Share Posted September 11, 2013 Another way to add scripts are by calling the controllers addJS method; $this->context->controller->addJS(_MODULE_DIR_.$this->name.'/js/<YOUR_SCRIPT>.js'); Link to comment Share on other sites More sharing options...
vekia Posted September 11, 2013 Share Posted September 11, 2013 this code doesn't work in back office (in getContent() function) Link to comment Share on other sites More sharing options...
jgullstr Posted September 11, 2013 Share Posted September 11, 2013 (edited) Certainly should work (in 1.5). Note that it calls the controller, not the module. Edited September 11, 2013 by jgullstr (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted September 12, 2013 Share Posted September 12, 2013 I wanted to pointed out that you can also add js and css by using the ActionAdminControllerSetMedia hook, as outlined here http://nemops.com/prestashop-products-new-tabs-fields/ In the step named "Properly enabling multilanguage fields in the product Back Office" 1 Link to comment Share on other sites More sharing options...
vekia Posted September 12, 2013 Share Posted September 12, 2013 nice catch Nemo i never heard about this hook Link to comment Share on other sites More sharing options...
NemoPS Posted September 12, 2013 Share Posted September 12, 2013 I discovered it by chance, I needed a way to add javascript because of the missing language flags bug on new tabs really useful! 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