Jump to:

22975 Posts in 11620 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Failure to find template files

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

Page: 1
Go to End
Author Topic: 584 Views
  • Parker1090
    Avatar
    Community Member
    38 Posts

    Failure to find template files Link to this post

    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!

  • simon_w
    Avatar
    Forum Moderator
    467 Posts

    Re: Failure to find template files Link to this post

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

  • Parker1090
    Avatar
    Community Member
    38 Posts

    Re: Failure to find template files Link to this post

    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

  • martbarr
    Avatar
    Community Member
    41 Posts

    Re: Failure to find template files Link to this post

    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...

  • Parker1090
    Avatar
    Community Member
    38 Posts

    Re: Failure to find template files Link to this post

    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
    584 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.