Theme Inheritance with Quark theme and 1.4.0-beta.3


#1

I’m using 1.4.0-beta.3 and the new Quark theme, and having issues with theme inheritance. It doesn’t seem to inherit the quark theme after following the directions for setting up an inherited theme (https://learn.getgrav.org/themes/customization).

Are there new steps that need to be followed for this?


#2

did you create your theme with devtools? If so you might need to change the order of the themes.

See this github issue: https://github.com/getgrav/grav-plugin-devtools/issues/9


#3

I didn’t use devtools, so they are ordered correctly, I think. I just found duplicate lines of code under a theme.yaml file in users/config/themes/. I removed it and it’s working but does not inherit any of the page classes from Quark.

For now, I’ll stick with an older theme for the inheritance.


#4

It ‘should’ work, but this has not been tested yet. I’ll make sure I test it before the official release.


#5

Using the new beta 1.4.0-rc.1

tried making a new theme with inheritance from Quark and got these two errors…

Template “@images/grav-logo.svg” is not defined in “partials/base.html.twig”

at line 42.

and at line 96

Solved the issue temporarily by directly linking the image lie this…


#6

Hi @dezbat, I just tried this and the error seems to be avoided if you use the Quark as the named theme to extend in your mytheme.php file:

<?php
namespace Grav\Theme;

use Grav\Common\Theme;

class myTheme extends Quark
{
}
?>

More info at: https://learn.getgrav.org/themes/customization#theme-inheritance

Does doing the same solve your issue?


Theme Problem with Quark Inheritance
#7

Hi @paulhibbitts — that works perfectly so far, many thanks…!


#8

Got the same problem, and even with this fix it does not change , i still have a blank html with only my content but not the style. I was with antimatter before and want to switch my inheritance to quark. I tried to put directly quark and it’s working.

Here is my mytheme.php :

<?php
namespace Grav\Theme;
use Grav\Common\Theme;
// class Mytheme extends Antimatter
class Mytheme extends Quark
{
   // Some new methods, properties etc.
}
?>

and my mytheme.yaml :

streams:
 schemes:
   theme:
     type: ReadOnlyStream
     prefixes:
       '':
         - user/themes/mytheme
         # - user/themes/antimatter
         - user/themes/quark 

Any idea ? Thanks in advance !


[Solved]Switch child theme from Antimatter to Quark
#9

The solution is to copy the content in the quark.yaml to mytheme.yaml and then put the streams


#10

Hi everyone;

I try to name mytheme by another name, let’s bob
I thought I simply have to replace every mytheme by bob but apparently I miss a detail because when I switch to bob Grav give me this error : Template “@images/grav-logo.svg” is not defined in “partials/base.html.twig” at line 44.

so inside ./theme/bob I have
blueprint.yaml which contain :

name: bob
version: 1.0.0
description: "Extending Quark"
icon:  microchip

bob.yaml which contain :

streams:
 schemes:
   theme:
     type: ReadOnlyStream
     prefixes:
       '':
         - user/themes/bob
         - user/themes/quark

bob.php which contain :

<?php
namespace Grav\Theme;
use Grav\Common\Theme;
class bob extends Quark
  {
  }
?>

and css/custom.css which is empty

So for now I turn with mytheme and everything is fine
but if someone knows how to personalise his identity I’ll take it

J


#11

It doesn’t work for me. I’ve used both @paulhibbitts mytheme.php and your suggestion to include quark.yaml in mytheme.yaml. But still an error: Template "modular.html.twig" is not defined..

# tree mytheme/
mytheme/
├── blueprints.yaml
├── images
│   ├── favicon.png
│   └── grav-logo.svg
├── mytheme.php
├── mytheme.yaml
└── templates
    └── partials

3 directories, 5 files

mytheme.yaml:

enabled: true
production-mode: true
grid-size: grid-lg
header-fixed: true
header-animated: true
header-dark: false
header-transparent: false
sticky-footer: true
blog-page: '/blog'
spectre:
  exp: false
  icons: false

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

How come this doesn’t work? While the documentation and the solutions point to a working solution. Did something change with Grav 1.6.4? I never tried this with older releases.


#12

Hi @AquaL1te, is this for Quark? I ask because I see antimatter in the stream rather than quark…


#13

@paulhibbitts well spotted! That was from yesterday, I was trying the same thing with different themes. I’ve changed that critical detail with the already present mytheme.php. It somewhat works now. I don’t get the error anymore, but the theme doesn’t look the same as loading vanilla theme.

Website with vanilla theme and the website with inheritance (but without any modifications). However, the grav-logo.svg and favicon.svg should replace the standard Grav logo’s, this is not the case at the moment. It’s a modular page in those screenshots.

Could it be that this theme not yet fully ready for inheritance? Since the mytheme.php also seems to be a quick fix.

EDIT: After loading the theme again, it seems to work! However, the icons are still unchanged. But will check this out in more detail. For now it seems okay. Thanks!


#14

Glad you got things going @AquaL1te! As you develop be sure to clear the cache when testing changes or just turn off the cache (both) during development via the system.yaml file https://learn.getgrav.org/basics/grav-configuration#system-configuration