giansi / gravstrap-theme

Gravstrap Theme helps you to start a new Grav CMS site with Bootstrap support and several ready to use modules. It is also perfect to start a new Bootstrap custom theme, to create your unique design.
MIT License
7 stars 12 forks source link

Extending gravstrap-theme #4

Closed mediaclinic closed 8 years ago

mediaclinic commented 8 years ago

I'm trying to extend theme to customize it, but Grav gives me error:

syntax error, unexpected '-', expecting '{'

Might be something to do with the hyphen. My code here:

class MyThemeName extends Gravstrap-Theme { }

giansi commented 8 years ago

Hi, you must not extend GravstrapTheme but Theme class:

use Grav\Common\Theme;

class MyThemeName extends Theme {}

though that's not mandatory, while you must add the follwing code to mytheme.yaml:

streams:
   schemes:
     theme:
       type: ReadOnlyStream
       prefixes:
         '':
         - user/themes/mytheme
         - user/themes/gravstraptheme

You will find more information about theme inheritance here: https://getgrav.org/blog/theme-development-with-inheritance