sunadarake/sculpin-new-posts-list-bundle

3rd party Sculpin Bundle that creates new posts list

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/sunadarake/sculpin-new-posts-list-bundle

1.0.1 2021-03-13 10:15 UTC

This package is auto-updated.

Last update: 2025-10-13 20:31:41 UTC


README

3rd party Sculpin Bundle that creates new posts list

Setup

composer require sunadarake/sculpin-new-posts-list-bundle

In your app/SculpinKernel.php

<?php

use Sculpin\Bundle\SculpinBundle\HttpKernel\AbstractKernel;
use Darake\SculpinNewPostsListBundle\SculpinNewPostsListBundle;

class SculpinKernel extends AbstractKernel
{
    protected function getAdditionalSculpinBundles(): array
    {
        return [
            SculpinNewPostsListBundle::class,
        ];
    }
}

How to use

In your template file, (for example layout/default.html)

<ul>
    {% for post in site.new_posts %}
    <li><a href="{{ site.url }}/{{ post.data.get('url') }}">{{ post.title }}</a></li>
    {% endfor %}
</ul>

In default configured, you can display 5 new posts.

If you need to change number of new posts to display, configure number of posts in app/config/sculpin_kernel.yml.

sculpin_content_types:
    posts:
        permalink: pretty
sculpin_new_posts_list:
    max_per_page: 10