dazmania Posted February 21, 2015 Share Posted February 21, 2015 Hi All, Please help - I am using AdminOrdersController.php as the basis for AdminmymoduleController.php but I am unable to get renderView to use my custom view.tpl file - I surmise this must be down to the location of my helpers/view/view.tpl file. If I copy: cp admin/themes/default/template/controllers/orders admin/themes/default/template/controllers/mymodule The view.tpl file is called as appropriate but having read several posts it seems more logical to place the template file with mymodule files here: /modules/mymodule/views/templates/admin/mymodule/helpers/view/view.tpl However this does not render successfully, just a blank page. Several posts confirm this to be the correct location and I've tried subtle variations but always fail to render. Can anyone please point me in the right direction with this, I don't see where I'm going wrong ? Maybe there is something I can turn on to find out which locations renderView is searching for view.tpl - or something ? Many thanks guys. D Link to comment Share on other sites More sharing options...
fred-vinapresta Posted February 21, 2015 Share Posted February 21, 2015 Hi, can you show the code of your controller? Link to comment Share on other sites More sharing options...
dazmania Posted February 21, 2015 Author Share Posted February 21, 2015 Hi, I copied AdminOrdersController.php to modules/my module/controllers/admin/AdminmymoduleController.php The initial view is working but when I click onto a customer order, renderView does not pick up the template. Cheers, D Link to comment Share on other sites More sharing options...
nhproject Posted February 21, 2015 Share Posted February 21, 2015 Try on views/controllername/helper... To sum up, append the files into a folder named with the controller name. Link to comment Share on other sites More sharing options...
nhproject Posted February 21, 2015 Share Posted February 21, 2015 There is a better explanation https://www.prestashop.com/forums/topic/347045-using-renderview-in-a-custom-moduleadmincontroller-ps16/ Link to comment Share on other sites More sharing options...
dazmania Posted February 21, 2015 Author Share Posted February 21, 2015 Thanks for the pointers guys.Here is the directory structure of my module, I've tried a couple of the suggested locations - but it's still not working, I just don't understand what I'm doing wrong. find ./mymodule/ | grep -v .old ./mymodule/ ./mymodule/config.xml ./mymodule/js ./mymodule/js/mymodule.js ./mymodule/install.sql ./mymodule/classes ./mymodule/entity ./mymodule/entity/MyModule.php ./mymodule/logo.gif ./mymodule/images ./mymodule/images/99.gif ./mymodule/logo.png ./mymodule/mymodule.php ./mymodule/views ./mymodule/views/templates ./mymodule/views/templates/admin ./mymodule/views/templates/admin/mymodule ./mymodule/views/templates/admin/mymodule/_new_product.tpl ./mymodule/views/templates/admin/mymodule/_customized_data.tpl ./mymodule/views/templates/admin/mymodule/form.tpl ./mymodule/views/templates/admin/mymodule/_documents.tpl ./mymodule/views/templates/admin/mymodule/form_customization_feedback.tpl ./mymodule/views/templates/admin/mymodule/_shipping.tpl ./mymodule/views/templates/admin/mymodule/_discount_form.tpl ./mymodule/views/templates/admin/mymodule/_product_line.tpl ./mymodule/views/templates/admin/mymodule/view ./mymodule/views/templates/admin/mymodule/view/view.tpl ./mymodule/views/templates/admin/mymodule/view/index.php ./mymodule/views/templates/admin/mymodule/index.php ./mymodule/views/templates/admin/mymodule/helpers ./mymodule/views/templates/admin/mymodule/helpers/list ./mymodule/views/templates/admin/mymodule/helpers/list/list_header.tpl ./mymodule/views/templates/admin/mymodule/helpers/list/index.php ./mymodule/views/templates/admin/mymodule/helpers/view ./mymodule/views/templates/admin/mymodule/helpers/view/view.tpl ./mymodule/views/templates/admin/mymodule/helpers/view/index.php ./mymodule/views/templates/admin/mymodule/helpers/index.php ./mymodule/views/templates/admin/mymodule/_print_pdf_icon.tpl ./mymodule/views/templates/admin/_print_pdf_icon.tpl ./mymodule/views/mymodule ./mymodule/views/mymodule/helper ./mymodule/views/mymodule/helper/list ./mymodule/views/mymodule/helper/list/list_header.tpl ./mymodule/views/mymodule/helper/list/index.php ./mymodule/views/mymodule/helper/view ./mymodule/views/mymodule/helper/view/view.tpl ./mymodule/views/mymodule/helper/view/index.php ./mymodule/views/mymodule/helper/index.php ./mymodule/views/mymodule/helpers ./mymodule/views/mymodule/helpers/list ./mymodule/views/mymodule/helpers/list/list_header.tpl ./mymodule/views/mymodule/helpers/list/index.php ./mymodule/views/mymodule/helpers/view ./mymodule/views/mymodule/helpers/view/view.tpl ./mymodule/views/mymodule/helpers/view/index.php ./mymodule/views/mymodule/helpers/index.php ./mymodule/views/mymodule.tpl ./mymodule/css ./mymodule/css/mymodule.css ./mymodule/css/Xmymodule.css ./mymodule/index.php ./mymodule/logo.jpg ./mymodule/uninstall.sql ./mymodule/controllers ./mymodule/controllers/admin ./mymodule/controllers/admin/AdminmymoduleController.php ./mymodule/controllers/front ./mymodule/controllers/front/default.php ./mymodule/controllers/front/index.php ./mymodule/controllers/index.php Link to comment Share on other sites More sharing options...
nhproject Posted February 22, 2015 Share Posted February 22, 2015 In my case, my controller is called AdminNhptImageManagerController. Because of this I had to put the overrided tpl in mymodule\views\templates\admin\nhpt_image_manager\helpers\list\list_action_view.tpl You just have to edit the method createTemplate in Helper class. There with xdebug or using a simple echo would see the expected path. 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