I’m having some issues with theme inheritance. I’ve used it fine before with the Twenty theme, but on this site with Alpha all the pages look like the CSS is missing. I created a folder in themes called mytheme and put this code in:
Yes, I did. Also, the site looks fine if I remove the line that says
– user/themes/mytheme
but then that kind of defeats the point of theme inheritance. Also, I should probably mention that this site is running on a local XAMPP environment on Windows.
So, those theme_url + '/assets/css/style-wide.css' lines in your init.js are referencing a theme_url variable that is defined on line 36 of alpha/templates/default.html.twig
That value is set to your_site_folder/user/themes/mytheme, which means all those CSS files (your_site_folder/user/themes/mytheme/assets/css/style-wide.css etc), can’t be loaded because we can’t handle that part with Grav’s streams.
You have two options here:
copy all those css files into your inherited theme (so your_site_folder/user/themes/mytheme/assets/css/style-wide.css etc do exist)
copy the alpha/templates/default.html.twig to your theme and manipulate the theme_url variable directly.
exactly Gert. This is how i did it with latest template I’m working on (striped):=. I created twig file from js file and used template variables like you said:
Thanks for the help guys. I do believe you’ve hit it sir Gert. I haven’t had a chance to try it yet, but I think that will work. Excellent community you’ve got going here guys. :]