Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Failure to find template files


Reply

5 Posts   1082 Views

Avatar
Parker1090

7 November 2013 at 3:16am Community Member, 38 Posts

Hello!

I'm having a bit of an issue with template files. To keep the code clean, and easy to maintain, I'm using the handy include function. However this seems to cause a bit of an issue.

The error I'm receiving is:
"[User Warning] None of these templates can be found in theme 'ppm': ContentBox.ss
GET /
Line 728 in /path-to-public_html/framework/view/SSViewer.php"

The file ContentBox.ss DOES exist.

I read in another post that a way to fix this is delete the whole of the SS cache, which seems to work, but is a pain doing it everytime I add a new include.

For reference, here's the stack trace:
None of these templates can be found in theme 'ppm': ContentBox.ss
SSViewer.php:728
SSViewer->__construct(ContentBox)
SSViewer.php:1025
SSViewer::execute_template(ContentBox,HomePage_controller,Array,SSViewer_DataPresenter)
.cache.themes.ppm.templates.Page.ss:38
include(/path-to-public_html/silverstripe-cache/domaincouk/.cache.themes.ppm.templates.Page.ss)
SSViewer.php:927
SSViewer->includeGeneratedTemplate(/path-to-public_html/silverstripe-cache/domaincouk/.cache.themes.ppm.templates.Page.ss,HomePage_controller,,Array,)
SSViewer.php:994
SSViewer->process(HomePage_controller)
Controller.php:203
Controller->handleAction(SS_HTTPRequest,index)
RequestHandler.php:200
RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
Controller.php:153
Controller->handleRequest(SS_HTTPRequest,DataModel)
ContentController.php:219
ContentController->handleRequest(SS_HTTPRequest,DataModel)
ModelAsController.php:68
ModelAsController->handleRequest(SS_HTTPRequest,DataModel)
RootURLController.php:129
RootURLController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:325
Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:143
Director::direct(,DataModel)
main.php:189
require_once(/path-to-public_html/framework/main.php)
index.php:66

I have no idea why it does this, but any help would be appreciated!

Thanks in advance!

Avatar
simon_w

7 November 2013 at 8:45am Forum Moderator, 474 Posts

Much like when adding a new class, you need to flush. You do this by appending ?flush=1 to the current URL.

Avatar
Parker1090

7 November 2013 at 8:51am Community Member, 38 Posts

I've done this many many times. Literally, the only way I've found to fix it is to delete the whole silverstripe cache folder.
I've tried flush=all, flush=1 and dev/build, just to try and get it working - but no joy.

Thank you for your reply though :)

Avatar
martbarr

7 November 2013 at 12:17pm (Last edited: 7 November 2013 12:18pm), Community Member, 46 Posts

Can we see the template code please, or at least the few lines round the include that produces the error?
And can you check the .ss file permissions...

Avatar
Parker1090

7 November 2013 at 10:52pm Community Member, 38 Posts

The body of the template file is as follows:

      <% include Header %>
      <% if Colour != None %><div id="titleBlock" class="bkgrd$Colour">
         <div class="maxBlock">
            $MainImage
         </div>
      </div><% end_if %>
      <% include ContentBox %>
      <% include Footer %>

I've also attached a screenshot showing the existing file.

However, it currently works. I've recently (this morning) deleted the ContentBox file, and the cache, and then reuploaded the ContentBox.ss file. Upon flushing, it works, so not sure what's going on here!

Attached Files