1

Anyone ever encounter this error when trying to view an asset (image) after upload? I'm working in homestead and everything appears to be compiling correctly, however the images don't render in the browser. The path shows up in dev tools and looks correct...any thoughts?

Craft\TemplateLoaderException

Unable to find the template “_layout”. (/home/vagrant/sites/my-craft-sites/wcs/craft/app/etc/templating/twigextensions/TemplateLoader.php:123)

#0 /home/vagrant/sites/my-craft-sites/wcs/craft/app/etc/templating/twigextensions/TemplateLoader.php(71): Craft\TemplateLoader->_findTemplate('_layout')
#1 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(265): Craft\TemplateLoader->getCacheKey('_layout')
#2 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(323): Twig_Environment->getTemplateClass('_layout', NULL)
#3 /home/vagrant/sites/my-craft-sites/wcs/craft/storage/runtime/compiled_templates/fc/9e/d83ba99cc7bfbe696da10fbdcf65536dc4ae270165035f00e6cfb3c5b953.php(10): Twig_Environment->loadTemplate('_layout')
#4 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(345): __TwigTemplate_fc9ed83ba99cc7bfbe696da10fbdcf65536dc4ae270165035f00e6cfb3c5b953->__construct(Object(Twig_Environment))
#5 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(292): Twig_Environment->loadTemplate('404')
#6 /home/vagrant/sites/my-craft-sites/wcs/craft/app/services/TemplatesService.php(220): Twig_Environment->render('404', Array)
#7 /home/vagrant/sites/my-craft-sites/wcs/craft/app/controllers/BaseController.php(74): Craft\TemplatesService->render('404', Array)
#8 /home/vagrant/sites/my-craft-sites/wcs/craft/app/controllers/TemplatesController.php(203): Craft\BaseController->renderTemplate('404', Array)
#9 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/actions/CInlineAction.php(49): Craft\TemplatesController->actionRenderError()
#10 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#11 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#12 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#13 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CWebApplication.php(282): CController->run('renderError')
#14 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CErrorHandler.php(331): CWebApplication->runController('templates/rende...')
#15 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CErrorHandler.php(204): CErrorHandler->render('error', Array)
#16 /home/vagrant/sites/my-craft-sites/wcs/craft/app/etc/errors/ErrorHandler.php(128): CErrorHandler->handleException(Object(Craft\HttpException))
#17 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CErrorHandler.php(129): Craft\ErrorHandler->handleException(Object(Craft\HttpException))
#18 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CApplication.php(732): CErrorHandler->handle(Object(CExceptionEvent))
#19 [internal function]: CApplication->handleException(Object(Craft\HttpException))
#20 {main}

1

I assume this is all in context of the control panel and not the front-end, correct?

If so and I had to guess, it looks like you're missing some Craft files on your box. Try downloading a fresh copy of Craft from http://buildwithcraft.com and replace your existing craft/app folder with the freshly downloaded one.

| improve this answer | |
  • Thanks Brad. I figured it out finally. It was actually two things. I had not updated the 404 html file so that fixed the templating "_layout" error. Then I realized that I had accidentally included /public in the url path for the assets. Once I removed that it worked. – Ryan Fleming May 6 '15 at 17:56
  • Glad you're all sorted, then! – Brad Bell May 6 '15 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.