You'll need to create a listing template for the base /projects
URL, and make that template render for that URL.
The easiest way is to just add a template called /templates/projects/index.html
, in which case Craft will automatically render that template whenever a user hits example.com/projects
.
Another way is to create a dynamic route, and point it to whatever template you want rendered for the /projects
URL.
Obviously, inside your listing template you'll need to pull the Structure entries manually, i.e. by doing something like this:
{% for entry in craft.entries.section('projects') %}
<article>
<h2><a href="{{ entry.url }}">{{ entry.title }}</a></h2>
...
</article>
{% endfor %}
Note that if you don't pass an .order()
parameter to your craft.entries
query, Craft will use the default order, which is the "manual" structure
order for Structure sections.
Also note that if your Structure is multi-level, you'll probably want to use the {% nav %}
tag over the basic {% for %}
loop:
{% nav entry in craft.entries.section('projects') %}
<li>
<a href="{{ entry.url }}">{{ entry.title }}</a>
{% ifchildren %}
<ul>
{% children %}
</ul>
{% endifchildren %}
</li>
{% endnav %}