I’ve followed Craft’s instructions to set up the blog: https://craftcms.com/docs/getting-started-tutorial/configure/section.html

When I published my first article, it returned a 404 error – see here: https://myvenue.com/blog/myvenue-scores-home-run-with-monarchs

Has anyone encountered and resolved this issue before?

  • Sounds like you just need to proceed through a few more steps in the Guide! Craft allows you to design your content architecture and add data, but it doesn't know how to display anything until you provide it some templates. Keep reading (all the way through the “Create Templates” section), and I bet you'll be able to figure out what's missing! 😉 Sep 15 at 3:19
  • In case you want an immediate solution, this error is telling you that there's no file to render at templates/blog/_entry.twig in your project folder. Create that file with just <h1>{{ entry.title }}</h1> as its content and you should see your new post's title! Sep 15 at 3:21

For development in general, when something isn't working it's important to look at the output and errors you're getting in order to figure out what's going wrong. In most cases, the error message will tell you exactly what isn't working and you can figure out what to do from there.

In this case, the error message is pretty clear:

Template not found: blog/_entry

This tells you that Craft is trying to render the blog entry using the template you have configured for this section in the settings, but the template doesn't exist. The solution, then, is to create that template. Try creating the file templates/blog/_entry.twig in your project. For starters, just output the entry title to ensure it's working:

{# templates/blog/_entry.twig #}
<h1>{{ entry.title }}</h1>

Then reload the page. You should see the title of your blog post. Then you can further develop your template. Follow the guide for creating templates to learn some best practices and common template structures.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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