1

I’m on a mac running MAMP and my install is functional. Localhost will direct to and display files in “templates” but it wont fully cooperate with subfolders within templates, such as templates/news. From templates/news/_entry.html, I’m able to {% extends "_layout" %} to the _layout.html, but I can’t call up anything via the block. Using {% block content %} is a no go.

I’m sure it’s a simple fix, but it’s hard to search for an answer when I don’t know where to start. Can anyone help?

Attached is a screengrab of my templates folder. You might notice from the "brews" folder that I've been following the Mijingo tutorial for Craft CMS. Nonetheless, the default "news" folder also doesn't load the block.

enter image description here

1
  • Perhaps adding some more information, a code example, or any error messages you get would help as for the moment, there isn't much to go on.
    – mrsmn
    Commented Aug 3, 2017 at 5:28

2 Answers 2

2

In this case, it was just human error and ignorance of how hidden template files work through the CMS.

I believed that I should be able to call the hidden file in the browser, via something like "base_url/subfolder/_hiddenfile.html" and partially I was able. For whatever reason, using this primitive test method, I was able to see the header and footer, but not the block content, in the browser window.

The fact is, what I was doing was not a viable test. I don't understand why, but that doesn't matter.

1

It's not a server sided issue you are running into. Best guess is that you deleted some of the original code in either the _layout.html or your new template file. When you first setup the environment did the basic Craft site which is set in the standard files show up?

Make sure you layout.html got the

{% block content %}

{% endblock %}

Aswell or else it doesn't know where to load. Did you also check your entries in the backend if they are set right?

This should be in your entry file:

{% extends "_layout" %}

{% block content %}

{% endblock %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.