devilsown Posted August 12, 2011 Share Posted August 12, 2011 I found this blog. http://www.prestashop.com/blog/article/modules_classes_and_controller_override_by_julien_breux/ Module override The modules are usually in the following format: /modules/mon_module/mon_module.tpl /modules/mon_module/mon_module.css /modules/mon_module/mon_module.js PrestaShop allows you to override or replace certain visible module files with new ones with the same theme. It couldn't be simpler, just do the following: /themes/prestashop/modules/mon_module/mon_module.tpl /themes/prestashop/css/modules/mon_modules/mon_module.css /themes/prestashop/js/modules/mon_modules/mon_module.js The new files will be used when you display your website. Ok so i created a /themes/mytemplate/modules/blockcategories/ and i put. blockcategories.tpl in it my site errors out. The only differnce between the stock blockcategories.tpl and mine is i have the the H4 line commented out. Do have to have a moduals/css and moduals/js in there even if i don't have modded files? Link to comment Share on other sites More sharing options...
tomerg3 Posted August 12, 2011 Share Posted August 12, 2011 No, just the tpl file is enough, what do you mean by "errors out" What's the error? Link to comment Share on other sites More sharing options...
devilsown Posted August 13, 2011 Author Share Posted August 13, 2011 I just get a white page. All i did was move the file that was located at /modules/blockcategories/ folder and moving it to the /themes/mytemplate/modules/blockcategories/ Link to comment Share on other sites More sharing options...
tomerg3 Posted August 13, 2011 Share Posted August 13, 2011 turn on error reporting /config/config.inc.php line #29 Link to comment Share on other sites More sharing options...
Paul C Posted August 13, 2011 Share Posted August 13, 2011 You say you "moved" it - does that mean it doesn't exist at the original location any more? It should exist in both places. The correct process is to make a "Copy" or to create a file from scratch with the same name. Paul Link to comment Share on other sites More sharing options...
devilsown Posted August 13, 2011 Author Share Posted August 13, 2011 sorry i copyed the file. So its in both places. Thanks for telling me about the error reporting tom. Link to comment Share on other sites More sharing options...
devilsown Posted August 13, 2011 Author Share Posted August 13, 2011 Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file '/home/devils/public_html/themes/devilsown/modules/blockcategories/category-tree-branch.tpl'' in /home/devils/public_html/tools/smarty/sysplugins/smarty_internal_template.php:163 Stack trace: #0 /home/devils/public_html/tools/smarty/sysplugins/smarty_internal_template.php(551): Smarty_Internal_Template->isExisting(true) #1 /home/devils/public_html/tools/smarty/compile/e59149d2bad33b82286addd416d5187f93380bc0.file.blockcategories.tpl.php(46): Smarty_Internal_Template->getRenderedTemplate() #2 /home/devils/public_html/tools/smarty/sysplugins/smarty_internal_template.php(433): include('/home/devils/pu...') #3 /home/devils/public_html/tools/smarty/sysplugins/smarty_internal_template.php(568): Smarty_Internal_Template->renderTemplate() #4 /home/devils/public_html/tools/smarty/Smarty.class.php(337): Smarty_Internal_Template->getRenderedTemplate() #5 /home/devils/public_html/classes/Module.php(1030): Smarty->fetch('/home/devils/pu...', ' in /home/devils/public_html/tools/smarty/sysplugins/smarty_internal_template.php on line 163 modules/blockcategories/category-tree-branch.tpl when a tpl calles another tpl file i guesss the 2nd file has to be in the new location too? Or is this a bug, as this file is not modded. But i have it working I guess not i need to move all my edited files over to it now so i can upgrade my site easier. Link to comment Share on other sites More sharing options...
tomerg3 Posted August 14, 2011 Share Posted August 14, 2011 I believe that when it includes another tpl file using relative path, you may need to copy the included file as well (I never actually tried it so not 100% sure) Link to comment Share on other sites More sharing options...
Rhapsody Posted December 8, 2011 Share Posted December 8, 2011 I too have a problem if I put the blockcategories.tpl file in my theme directory as an override. It works if the file is in the modules/bockcategories directory All the other module tpl file overrides I've made work just fine in the theme directory. As an experiment - take the stock blockcategories.tpl file and put it in the themes/prestashop/modules/blockcategories directory and see what happens - it breaks the front page of your shop. Any ideas on how to make this work as an override to make automatic upgrades easier? Link to comment Share on other sites More sharing options...
tomerg3 Posted December 8, 2011 Share Posted December 8, 2011 What do you mean breaks the shop? did you turn on error reporting to see the actual error (/config/config.inc.php line #29). All module override tpl files should go to /themes/your_theme/modules/module_name/ Link to comment Share on other sites More sharing options...
Rhapsody Posted December 8, 2011 Share Posted December 8, 2011 Yes - I get a white screen if the file is in the theme override for that module. All other modules I have with .tpl overrides work fine. I put the file in the path shown for my custom theme and also tried it with the prestashop theme to verify the problem is not due to my custom theme. Try it on a generic shop with the .tpl override in the prestashop theme and see if you have the same problem I do. It does it on two shops I have on differnt servers. Link to comment Share on other sites More sharing options...
Rhapsody Posted December 9, 2011 Share Posted December 9, 2011 I found the fix for blockcategories tpl override. If you have blockcategories.tpl in yourtheme/modules/blockcategories directory for override, you also have to put the file category-tree-branch.tpl in the same directory. This clears up the white screen problem on the front page, and allows easier autoupgrade. If this works for devilsown, the subject can be marked as solved! Link to comment Share on other sites More sharing options...
tomerg3 Posted December 9, 2011 Share Posted December 9, 2011 If you had turned on error reporting as I suggested, the mysterious white screen would have shown the actual error Link to comment Share on other sites More sharing options...
Rhapsody Posted December 9, 2011 Share Posted December 9, 2011 I did - I just didn't have the time to play with it until tonight. That's how I found it! Should I report the problem on the bug tracker so the proper file references can be fixed? A tpl override shouldn't cause a white screen. 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