2

I'm quite sure the problem is my paths to .css files in the _layout.html file but just can't get my head around it.

I've got this in my _layout.html. It works for home page and news page.

{% includeCssFile "css/material.css" %}
{% includeCssFile "css/main.css" %}

But then I get the unstyled page when viewing a specific news entry. _entry.html is not extending _layout.html

My CSS files are on the same level as my templates. What should these paths be?

Luke Pearce
  • 3,863
  • 1
  • 11
  • 25
Miksu Aaja
  • 51
  • 2

1 Answers1

2

News/_entry should definitely be extending _layout (or any layout you want to use). That's how it's setup when you download a fresh copy of Craft as well.

{% extends "_layout" %}

The CSS file should not be in the templates folder (that's only for twig templates), but in your web root which is the same folder as index.php. In your case that would probably be something like public/css/material.css and public/css/main.css Also make sure that any assets used in these CSS files are located in that folder instead of the templates folder.

Unless these CSS files are specific to the news entry template I'd also include them in the layout file.