I have a collection of articles and I'm trying to figure out a more elegant way to either show the latest article for when the user accesses "/articles" or the selected article if a user navigates to "/articles/some-article".
Below is my current implementation, is there an easier way?<v:if param="id">
<v:template filename="entry" />
</v:if>
<v:else>
<v:collection path="entries" limit="1">
<v:template filename="entry" />
</v:collection>
</v:else>
That's pretty much how you do it. You check for the existence of a variable if it's a permalink page, if not show the first entry in the collection, which can be done with v:section<v:section path="entries">
<v:template filename="entry" />
</v:section>
You could also just separate the permalink page into a new page: "/article/some-article"
It looks like you're new here. If you want to get involved, click one of these buttons!