Answers.Body: <p>I'd say best to stick with where Civix (aka Tim) says it should go! (i.e. no subdirs) - and note that Civix can help you create the page:</p>
  
  <p><a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addabasicwebpage" rel="nofollow">https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addabasicwebpage</a></p>
  
  <p>To generate a Page:</p>
  
  <pre><code>me@civisys:/home/me$ cd /var/www/extensions/com.example.myextension
  me@civisys:/var/www/extensions/com.example.myextension$ civix generate:page --help
  Usage:
   generate:page className webPath
  
  Arguments:
   className  Page class name (eg "MyPage")
   webPath    The path which maps to this page (eg "civicrm/my-page")
  
  me@civisys:/var/www/extensions/com.example.myextension$ civix generate:page Greeter civicrm/greeter
  Write /var/www/extensions/com.example.myextension/xml/Menu/myextension.xml
  Write /var/www/extensions/com.example.myextension/CRM/Myextension/Page/Greeter.php
  Write /var/www/extensions/com.example.myextension/templates/CRM/Myextension/Page/Greeter.tpl
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-20T17:32:36.353Z
Answers.Text: @karing-semper- Is it possible to create subdirs at all? I feel creating subdirs makes it more clean and more readable. Also can you please see the update?
Answers.UserDisplayName: Dilip Raj Baral
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-20T17:44:48.543Z
Answers.Text: I really don't think subdirs are necessary as essentially these Pages are already in subdirectories by extension. When you create the Pages manually - don't forget the class name: example in our iATSAdmin.php: class CRM_iATS_Page_iATSAdmin extends CRM_Core_Page {
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-20T17:46:03.597Z
Answers.Text: Civix is not compulsory - but it adds all you need in one command line - I still tend to use it - just b/c it's faster than generating pages (php and tpl) and adding in the class by hand
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-20T18:03:06.997Z
Answers.Text: It's indeed faster. I just figured the template wasn't loading because I had omitted `parent::run()` on the `run()` method. Thanks. :)
Answers.UserDisplayName: Dilip Raj Baral
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-20T16:53:11.997Z
Answers.LastActivityDate: 2016-06-20T16:53:11.997Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>I have set environment to Development and Disabled asset cache at at/civicrm/admin/setting/debug?reset=1
  It worked for me.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-08T13:08:18.243Z
Answers.LastActivityDate: 2018-03-08T13:08:18.243Z
Answers.UserDisplayName: chitra jajoria
Body: <p>I added a new page in this hierarchy:
  <code>CRM/Mymodule/Page/subdir/MyPage.php</code>
  and added a template file at
  <code>templates/CRM/Mymodule/subdir/MyPage.tpl</code>.</p>
  
  <p>But when I run <em>MyPage.php</em>, I get a blank page. Template contents aren't displayed. Adding <em>smartyDebug=1</em> to the URL doesn't trigger a popup either. Strangely though, if I <em>var_dump</em> a variable, I can see the page with menu bar, page title and the variable info. So <em>MyPage.php</em> is being invoked.</p>
  
  <p>Is it that pages don't support subdirectories? I tried adding the template file using <em>Region</em>. That didn't work either.</p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>I created a page and a corresponding template on <code>CRM/Mymodule/Page/MyPage.php</code> and <code>templates/CRM/Mymodule/MyPage.tpl</code> respectively and manually wrote a route. It didn't work. I then used civix to generate the same page and template. It worked. So, is it compulsory that we create using <code>civix</code>? But I had manually created the form and it had worked.</p>
  
Tags: <templates>
Title: Template file not loading
ThreadText: # Template file not loading
  
  (Asked by: username_0 on 2016-06-20)
  
  I added a new page in this hierarchy:
  `CRM/Mymodule/Page/subdir/MyPage.php`
  and added a template file at
  `templates/CRM/Mymodule/subdir/MyPage.tpl`.
  
  But when I run *MyPage.php*, I get a blank page. Template contents aren't displayed. Adding *smartyDebug=1* to the URL doesn't trigger a popup either. Strangely though, if I *var\_dump* a variable, I can see the page with menu bar, page title and the variable info. So *MyPage.php* is being invoked.
  
  Is it that pages don't support subdirectories? I tried adding the template file using *Region*. That didn't work either.
  
  **UPDATE**:
  
  I created a page and a corresponding template on `CRM/Mymodule/Page/MyPage.php` and `templates/CRM/Mymodule/MyPage.tpl` respectively and manually wrote a route. It didn't work. I then used civix to generate the same page and template. It worked. So, is it compulsory that we create using `civix`? But I had manually created the form and it had worked.
  
  **Tags:** templates
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-06-20. Score: 3 | Accepted answer
  
  I'd say best to stick with where Civix (aka Tim) says it should go! (i.e. no subdirs) - and note that Civix can help you create the page:
  
  <https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addabasicwebpage>
  
  To generate a Page:
  
  ```
  me@civisys:/home/me$ cd /var/www/extensions/com.example.myextension
  me@civisys:/var/www/extensions/com.example.myextension$ civix generate:page --help
  Usage:
   generate:page className webPath
  
  Arguments:
   className  Page class name (eg "MyPage")
   webPath    The path which maps to this page (eg "civicrm/my-page")
  
  me@civisys:/var/www/extensions/com.example.myextension$ civix generate:page Greeter civicrm/greeter
  Write /var/www/extensions/com.example.myextension/xml/Menu/myextension.xml
  Write /var/www/extensions/com.example.myextension/CRM/Myextension/Page/Greeter.php
  Write /var/www/extensions/com.example.myextension/templates/CRM/Myextension/Page/Greeter.tpl
  
  ```
  
  > **Comments:**
  > **username_0**: @username_1-semper- Is it possible to create subdirs at all? I feel creating subdirs makes it more clean and more readable. Also can you please see the update?  
  > **username_1**: I really don't think subdirs are necessary as essentially these Pages are already in subdirectories by extension. When you create the Pages manually - don't forget the class name: example in our iATSAdmin.php: class CRM_iATS_Page_iATSAdmin extends CRM_Core_Page {  
  > **username_1**: Civix is not compulsory - but it adds all you need in one command line - I still tend to use it - just b/c it's faster than generating pages (php and tpl) and adding in the class by hand  
  > **username_0**: It's indeed faster. I just figured the template wasn't loading because I had omitted `parent::run()` on the `run()` method. Thanks. :)  
  
  ---
  
  ### Answer by username_2 on 2018-03-08. Score: 0
  
  I have set environment to Development and Disabled asset cache at at/civicrm/admin/setting/debug?reset=1
  It worked for me.
  
  
  ---
  
  