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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Failure to find template files


Go to End


8 Posts   5718 Views

Avatar
Parker1090

Community Member, 46 Posts

7 November 2013 at 3:16am

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
(deleted)

Community Member, 473 Posts

7 November 2013 at 8:45am

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

Avatar
Parker1090

Community Member, 46 Posts

7 November 2013 at 8:51am

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

Community Member, 59 Posts

7 November 2013 at 12:17pm

Edited: 07/11/2013 12:18pm

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

Community Member, 46 Posts

7 November 2013 at 10:52pm

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
Avatar
Tama

Community Member, 138 Posts

31 December 2014 at 10:18am

Did you ever find out what the issue was? I've got something similar going on and it's driving me crazy.

Avatar
justin_t_brown

Community Member, 22 Posts

21 August 2015 at 5:20am

Me too.

Avatar
motoservo

Community Member, 27 Posts

28 August 2015 at 2:18pm

Edited: 28/08/2015 7:15pm

yeah, +1 here.

Just trying to get a basic installation up and running and two weeks later I'm still not there yet. While distracted for a few days troubleshooting something else my blog module, which was working before, started producing a similar error to yours (although from a different module and requiring different templates). Neither a ?flush or dev/build or deleting the whole cache at /private/var/tmp helped.

I switched the theme back to Simple but got the same results.
None of these templates can be found in theme 'simple': Widget.ss, DataObject.ss, ViewableData.ss, Object.ss

UPDATE: Fix is here...
http://www.silverstripe.org/community/forums/general-questions/show/12759