Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typhoon --> child template --> Twig \ Error \ RuntimeError #50

Closed
anico-sy opened this issue Feb 16, 2021 · 15 comments
Closed

Typhoon --> child template --> Twig \ Error \ RuntimeError #50

anico-sy opened this issue Feb 16, 2021 · 15 comments
Assignees
Labels
bug Something isn't working typhoon Typhoon theme

Comments

@anico-sy
Copy link

Hi

I created a Custom Theme with the Typhoon-Theme (licenced)
According to:
https://getgrav.org/premium/typhoon/docs#create-a-custom-theme-from-typhoon
activated it in the admin tool
Delete cache in the admin tool

now I have a
Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("HEX
color needs to be 6 or 3 digits long").

see https://www.anico.ch/issue/

Anybody knows what is the reason for this issue?

Thanks and best regards
Bernhard

@w00fz
Copy link
Member

w00fz commented Feb 16, 2021

Hi @anico-sy,

The error seems to indicate you have a wrong hex color defined for your primary color, what’s the value you are using?

@w00fz w00fz added question Further information is requested typhoon Typhoon theme labels Feb 16, 2021
@anico-sy
Copy link
Author

Hi

Screenshot before change:
https://www.anico.ch/issue/forum/primary_color.png
in the template typhoon I changed the primary-color to
#137df5
in the child theme, I do not see any color definition in the yaml-files

Where can be a primary color?

Thanks in advance
Bernhard

@anico-sy
Copy link
Author

or do I have to copy the
typhoon.yaml
to the child theme and rename it?

@anico-sy
Copy link
Author

OK.... I see already the problem.
There is file-content missing in the child.

I copied the typhoon.yaml
https://www.anico.ch/issue/
to the child and than the HEX error is gone.

Question: Which files I have to copy from the typhoon to the child?

Thanks
Bernhard

@rhukster
Copy link
Member

That is actually normal behavior for child themes. The configuration YAML is critical for the theme and not inherited. It should be copied to the cold theme per the documentation: https://learn.getgrav.org/17/themes/customization#inheriting-using-the-cli

@anico-sy
Copy link
Author

Hi
I made all the steps:
Inheriting using the CLI
https://learn.getgrav.org/17/themes/customization#inheriting-using-the-cli

then I got the
ERROR: default.html.twig template not found for page: /
on page https://www.anico.ch/issue/

than
I copied default.html.twig from thypoon to
/user/themes/anico/templates/default.html.twig

but than I got the error
"partials/base.html.twig is missing.

I think, there is still a misfunction of the inherit function.
I understand, that Inheriting should get the missing files from the Typhoon-template.

Do you have an idea what is the issue?

@rhukster
Copy link
Member

It sounds like your theme didn’t get setup properly with inheritance. If you used the devtools approach everything should just work out of the box. It does for me in my test child theme. Perhaps you can zip up your child theme and attach it and I can take a look?

@anico-sy
Copy link
Author

Hi
below the link to the child-theme
https://www.anico.ch/issue/user/themes/anico.zip

Thanks!

@rhukster
Copy link
Member

rhukster commented Feb 17, 2021

Ok I don't think you used the bin/plugin devtools command because your files are incorrect. you have a _anico.yaml with the stream information but this should be at the top of your anico.yaml file:

streams:
 schemes:
   theme:
     type: ReadOnlyStream
     prefixes:
       '':
         - user/themes/anico
         - user/themes/typhoon

enabled: true                                                       # Enable the theme
production: false                                                   # production | development (compiled or development version of css)
append_site_title: true                                             # Append Site Title to HTML Title
custom_logo:                                                        # Will be used instead of default Grav logo
custom_logo_strip_svg_style: false    
....

Then it should work

@anico-sy
Copy link
Author

Hi
The _anico.yaml ist just the save from the discussion yesterday.
_anico.yaml was generated with the devtool command.
anico.yaml I transfered manually see the discussion above.

@rhukster
Copy link
Member

I just created the theme from devtools:

➜ bin/plugin devtools new-theme

 Enter Theme Name:
 > Anico

 Enter Theme Description:
 > Anico - Typhoon Child Theme

 Enter Developer Name:
 > Anico

 Enter GitHub ID (can be blank):
 > 

Enter Developer Email:
 > xxxxxxxx

 Please choose an option:
  [pure-blank ] Basic Theme using Pure.css
  [inheritance] Inherit from another theme
  [copy       ] Copy another theme
 > inheritance

 Please choose a theme to extend:
  [0] bootstrap4
  [1] quark
  [2] typhoon
  [3] typhoon-copy
 > 2


SUCCESS theme Anico -> Created Successfully

Path: /xxx/xxxx/xxxx/grav/user/themes/anico

Here's the resulting theme zipped up.

anico.zip

@anico-sy
Copy link
Author

Hi
I uploaded the folder anico. Delete all caches
https://www.anico.ch/issue/
Nothing changed....

@rhukster
Copy link
Member

Apologies, it does seem like there's something wrong with the devtools process. It created the anico.yaml but it didn't include the default yaml below it. quick fix is to copy the contents of typhoon.yaml and paste it under the streams section of the anico.yaml. Just like the example i showed here: #50 (comment)

I just tested and that fixed the problem.

@rhukster rhukster self-assigned this Feb 18, 2021
@rhukster rhukster added bug Something isn't working and removed question Further information is requested labels Feb 18, 2021
@rhukster
Copy link
Member

Fixed devtools to address this.. will be available soon

@anico-sy
Copy link
Author

Hi
It is ok now :-)
Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working typhoon Typhoon theme
Projects
None yet
Development

No branches or pull requests

3 participants