Trouble getting themes to load

I’m new to Grav, and I’m having trouble getting themes to load properly. I have it installed on my laptop and my VPS, Arch and Debian respectively, and when I change from Quark, it appears that the HTML doesn’t even get rendered. This is what I see:

<link href="/user/themes/grayscale/css/bootstrap.min.css" type="text/css" rel="stylesheet"> <link href="/user/themes/grayscale/css/grayscale.css" type="text/css" rel="stylesheet"> <link href="/user/themes/grayscale/css/font-awesome/css/font-awesome.min.css" type="text/css" rel="stylesheet"> <link href="/user/plugins/markdown-notices/assets/notices.css" type="text/css" rel="stylesheet">
Grav

<h1>My Home Page or Whatever...</h1> <h2>tips, tricks, interesting, ramblings, etc.</h2> <p>This page is somewhat a project to learn Grav as a CMS and blogging solution. I like it because I can write new articles, pages, whatever in vim using markdown and that's it. No stupid database to keep up with, the admin panel is largely optional... It just seems like a pretty slick solution. I don't really have much to talk about, so this is just a collection of short how-to articles and that sort of thing. It's not really for anyone but me.</p> <h3>Find out all about Grav</h3> <ul> <li>Learn about <strong>Grav</strong> by checking out our dedicated <a href="http://learn.getgrav.org">Learn Grav</a> site.</li> <li>Download <strong>plugins</strong>, <strong>themes</strong>, as well as other Grav <strong>skeleton</strong> packages from the <a href="http://getgrav.org/downloads">Grav Downloads</a> page.</li> <li>Check out our <a href="http://getgrav.org/blog">Grav Development Blog</a> to find out the latest goings on in the Grav-verse.</li> </ul>

Copyright © Grav 2014 · by VC
<script src="/system/assets/jquery/jquery-2.x.min.js"></script> <script src="/user/themes/grayscale/js/bootstrap.min.js"></script> <script src="/user/themes/grayscale/js/jquery.easing.min.js"></script> <script src="/user/themes/grayscale/js/grayscale.js"></script> 

I’ve tried using the Admin panel on the Arch install and directly editing the user/config/system.yaml on the Debian install with the same results. I can switch back to Quark, and it’s fine. I was even able to switch to DarkQuark and it worked, but Grayscale doesn’t work on either system. I also tried Chalk on my laptop/Arch install and had the same result.

I don’t have any idea what would cause this. I’m not finding anything in my system logs.

UPDATE: It actually is rendering the html. If I view the source, it’s showing &gt; and &lt; everywhere. It also has the usual html tags in the source. Totally bizzare!!

You most likely have old theme designed for Grav 1.6 (or older), which presumes content is not escaped. In your theme wherever the templates content with HTML tags is outputted, you should add |raw filter. Eg. {{ template_output|raw }}

1 Like

Did a quick run on all themes. It seems that 77/112 themes do not use filter |raw on *content, *css() or *js()

I created an issue to start a discussion with the team to notify developers and users for this.

2 Likes

I’ve been going through the theme file by file searching for }} and adding |raw where applicable. I finally got it to load though there are still some errors. Changing the line {{ assets.css() }} to {{ assets.css()|raw }} is what finally got the stylesheets to load.

Thanks for the help. I wonder if I should clone the theme from github and submit my fixes? I don’t know much about grav yet, but I seem to be making progress on getting this theme to work.

If theme is still supported, then why not :slight_smile: