Jump to content

mymodule renderView - where to place custom view.tpl file ?


dazmania
 Share

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

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
 Share

×
×
  • Create New...

Important Information

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