Display posts with it's information on Welcome page
Created 6 years ago by alexnite

Hello! I am very new to PyroCMS and my first issue is that I am trying to display recent posts in the welcome page. For example it would be displayed as if it was a blog, but just the recent posts. Any help is greatly appreciated!

Thank you!

piterden  —  6 years ago

What is the problem? I've tried and everything works fine.

alexnite  —  6 years ago

I don't know how to display them in the welcome page?

ryanthompson  —  6 years ago

If you want you can include this in your page type layout or in an HTML field that's rendered in the page for the page for example.. but the entries code would be similar to:

<ul>
    {% for post in entries('posts', 'posts').recent().get() %}
    <li>
        {{ html_link(post.route('view'), post.title) }}
    </li>
    {% endfor %}
</ul>