Problems with some themes

Hello, just starting out with Grav and enjoying it thus far. I’ve had two issues thus far, 1 solved, 1 not. The solved was not being able to access bin/grav or bin/gpm commands on a shared server. I had to prefix the commands with php55 since the default php was 5.2. Wanted to pass that along.

My unsolved problem is that in trying out different themes, some are throwing an error. This has happened on both my mac (using MAMP) and now currently on my shared host. Right now antimatter, afterburner2, and bootstrap will work, the others, like hpstr, mediator, or sidewalk don’t. I clear the cache each time and yet get the following error:

RuntimeException (404)
Template “blog.html.twig” is not defined ()

The specific problem is in /system/src/Grav/Common/Twig.php with line 284 highlighted:
throw new \RuntimeException($e->getRawMessage(), 404, $e);

Any thoughts on how to fix, or other diag info needed to research?

Thanks!

Glad you got your first issue sorted out. I have documented similar hosting setups that required modifying the $PATH variable on the account in order for your shell to pick up the correct version of PHP. The following example is for Siteground, but a similar setup is probably required for your hosting:

Setup CLI PHP

The next question about themes requires a bit of understanding about how Grav and theming works. Luckily I just wrote a blog post on this very thing! I suggest reading the post first to give you a good overview of how Grav works in regards to theming.

TL;DR

Grav themes are not necessarily like WordPress or Joomla themes. The content in Grav is a bit part of the equation. The errors your seeing are because the theme is not built to support the particular content template you are trying to view. Every theme for Grav usually comes with either a Skeleton package that is like a RocketTheme RocketLauncher (ie, Grav, content, plugin s, theme, configuration). Or it comes with some sample pages to show what it supports.

I strongly feel this is a better way to be building sites than traditional CMS platforms have provided in the past.

Thanks for the response. Just need to wrap my head around that the user/pages folder structure can vary by theme. Makes sense given the multiple types of sites Grav can support.

Might want to add a message in bin/gpm to let users know to check their template structure when changing themes…

We have been talking about having an option to auto-install pages provided by a theme (with user approval of course) when installed via GPM.

I like autoinstall pages demo :smiley:

sigh, having the exact issue as blenderking as i am on shared hosting at mediatemple, but unlike him i do not know how to cheat with the prefix php55 :frowning:
also, not sure where to make the bin folder in my server, in the html folder?

First mediatemple has been found to be the worst possible hosting for Grav. This is because they use some kind of grid-based file system. This must be a sort of network shared system because it is really slow. And for a file-based CMS this is huge problem.

Anyway, performance aside, you need to first find what version of PHP is installed by default in the CLI. If it’s 5.2 like the original poster, yes, you definitely need to use a more modern version if installed.

If you dont’ have the knowledge on how to do this, I suggest contacting media temple support and ask them: How can I run PHP 5.4+ in the CLI, they should be able to help you.

Also, the bin folder of Grav should not be moved. Just leave it as is.

the problem is that my server IS running 5.5, but the CLI environment is not reading it. i tried mt for help, and the guy said “it was beyond him”.

so, any recommended hosting for grav?

i see, chapter 7!

OMG, if MT support can’t help you with this really simple thing, I strongly suggest changing hosting providers. That is absolutely shocking to me that they can’t/won’t help you with this. Don’t give them any more of your money!

Check out our list of quality hosting providers

i switched to Rochen a few hours ago :slight_smile:

Nice! I think you’ll have better luck there for sure. Grav runs really fast on those new SSD cloud-servers they have.

up and running and trouble-free

Good deal :slight_smile: