Should I create a Single for the blog home page content (/blog) and then a Channel to hold the entries (/blog/{slug})?
The blog index page also needs to have non blog entries on, i.e. intro text describing what the blog is about.
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It only takes a minute to sign up.
Sign up to join this communityShould I create a Single for the blog home page content (/blog) and then a Channel to hold the entries (/blog/{slug})?
The blog index page also needs to have non blog entries on, i.e. intro text describing what the blog is about.
A Channel called Blog as follows:
In blog/_entry.html:
{% extends "_layout" %}
{% set title = "{{ entry.title }}" %}
{% block content %}
<article>
<h2><a href="{{ entry.url }}">{{ entry.title }}</a></h2>
{{ entry.body }}
<p>Written by {{ entry.author }} on {{ entry.postDate|date('M d, Y') }}</p>
</article>
{% endblock %}
You don't need to create a Single for the Blog index page.
You can just create a template file: blog/index.html with:
{% extends "_layout" %}
{% set title = "Blog" %}
{% block content %}
{% for entry in craft.entries.section('blog').find() %}
<article>
<h2><a href="{{ entry.url }}">{{ entry.title }}</a></h2>
{{ entry.body }}
<p>Written by {{ entry.author }} on {{ entry.postDate|date('M d, Y') }}</p>
</article>
{% endfor %}
{% endblock %}
EDIT:
If it is a requirement for end users to be able to publish and edit content, other than blog entries, appearing on Blog index page via the CP, then a Single is the way to go.
In blog/index.html:
{% extends "_layout" %}
{% set title = "Blog" %}
{% block content %}
{{ entry.customField }}
{% for entry in craft.entries.section('blog').find() %}
<article>
<h2><a href="{{ entry.url }}">{{ entry.title }}</a></h2>
{{ entry.body }}
<p>Written by {{ entry.author }} on {{ entry.postDate|date('M d, Y') }}</p>
</article>
{% endfor %}
{% endblock %}