PHPackages                             pixelopen/sulu-newsbundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. pixelopen/sulu-newsbundle

ActiveSulu-bundle[Admin Panels](/categories/admin)

pixelopen/sulu-newsbundle
=========================

Manage news for Sulu

2.7.1(7mo ago)24321MITPHPPHP ^8.1CI failing

Since Feb 10Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/Pixel-Open/sulu-newsbundle)[ Packagist](https://packagist.org/packages/pixelopen/sulu-newsbundle)[ Docs](https://github.com/Pixel-Open/sulu-newsbundle)[ RSS](/packages/pixelopen-sulu-newsbundle/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (7)Dependencies (13)Versions (9)Used By (0)

Sulu news bundle
================

[](#sulu-news-bundle)

[![Minimum PHP Version](https://camo.githubusercontent.com/ce4853f487ac82c0ad9f925ebf93810c21278dccb05579d177d9df4a154c9be8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e302d677265656e)](https://php.net/)[![Minimum Sulu Version](https://camo.githubusercontent.com/41ac6dc947faae456473023550dff677190cf95730511eb076f6d06ac4a2690a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73756c752d253345253344253230322e362d677265656e)](https://symfony.com)[![GitHub release](https://camo.githubusercontent.com/30a68e7999ce347c6b227c18d0c4276c36d1ee2fc46faa3fbcf9ee5b061cebdf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f506978656c2d4f70656e2f73756c752d6e65777362756e646c65)](https://github.com/Pixel-Open/sulu-newsbundle/releases)[![Quality Gate Status](https://camo.githubusercontent.com/07ffd20c94caf5dd0659855d6aa95a51453c1bf21e0d85c87df9d729c2332d1e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d506978656c2d4f70656e5f73756c752d6e65777362756e646c65266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/summary/new_code?id=Pixel-Open_sulu-newsbundle)

Presentation
------------

[](#presentation)

A Sulu bundle to manage the news of your website.

Requirements
------------

[](#requirements)

- Symfony &gt;= 5.4
- Composer

Features
--------

[](#features)

- List view of News (smart content)
- Without elasticsearch
- Routing
- Preview
- SULU Media include
- Content Blocks (Title,Editor,Image,Quote)
- Activity Log
- Trash
- Automation
- SEO

Installation
------------

[](#installation)

### Install the bundle

[](#install-the-bundle)

Execute the following [composer](https://getcomposer.org/) command to add the bundle to the dependencies of your project:

```
composer require pixelopen/sulu-newsbundle
```

### Enable the bundle

[](#enable-the-bundle)

Enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
return [
    /* ... */
    Pixel\NewsBundle\NewsBundle::class => ['all' => true],
];
```

### Update schema

[](#update-schema)

```
bin/console do:sch:up --force
```

Bundle Config
-------------

[](#bundle-config)

Define the Admin Api Route in `routes_admin.yaml`

```
news.news_api:
  type: rest
  prefix: /admin/api
  resource: pixel_news.news_route_controller
  name_prefix: news.
```

Use
---

[](#use)

### Add/Edit a news

[](#addedit-a-news)

Go to the "News" section in the administration interface. Then, click on "Add". Fill the fields that are needed for your use.

Here is the list of the fields:

- Title (mandatory)
- URL (mandatory and filled automatically according to the title)
- Published at (manually filled)
- Cover
- Category (mandatory)
- Content

The "Content" field is a block content type. The different type of block come from the [Sulu Block Bundle](https://github.com/Pixel-Developpement/sulu-block-bundle)

Once you finished, click on "Save"

Your news is not visible on the website yet. In order to do that, click on "Publish?". It should be now visible for visitors.

To edit a news, simply click on the pencil at the left of the news you wish to edit.

### Categories

[](#categories)

As you may have seen in the previous section, a news needs a category. These categories need to be created in a very specific way:

- You **must** create a root category which **must** have its key named "news"
- Then, under this root category, you create all the news categories you need

### Remove/Restore a gallery

[](#removerestore-a-gallery)

There are two ways to remove a news:

- Check every news you want to remove and then click on "Delete"
- Go to the detail of a news (see the "Add/Edit a news" section) and click on "Delete".

In both cases, the news will be put in the trash.

To access the trash, go to the "Settings" and click on "Trash". To restore a news, click on the clock at the left. Confirm the restore. You will be redirected to the detail of the news you restored.

To remove permanently a news, check all the news you want to remove and click on "Delete".

Settings
--------

[](#settings)

This bundle comes with settings. There is only one setting, it's the configuration of a default image. To access the bundle settings, go to "Settings &gt; News management".

Twig extension
--------------

[](#twig-extension)

There are several twig functions in order to help you use the news and settings on your website:

**get\_latest\_news(limit, local)**: returns the latest news. It takes two parameters:

- limit: represents the number of the latest news to display. If no limit is provided, the default value is 3
- locale: the locale in which the news should be retrieved. If no local is provided, the default value is 'fr'

Example of use:

```

    {% set news = get_latest_news(4, app.request.locale) %}
    {% for new in news %}

                {% if new.cover.id is defined %}
                    {% set cover = sulu_resolve_media(new.cover.id, 'fr') %}

                {% endif %}
                {{ new.title }}
                {{ new.publishedAt|date("d/m/Y") }} {#- {{ new.category }} #}

    {% endfor %}

```

**get\_latest\_news\_html(limit, locale)**: same as get\_latest\_news but it renders a view instead. It takes two parameters:

- limit: represents the number of the latest news to display. If no limit is provided, the default value is 3
- locale: the locale in which the news should be retrieved. If no local is provided, the default value is 'fr'

Example of use:

```

    {{ get_latest_news_html(4, app.request.locale) }}

```

**news\_settings()**: returns the settings of the bundle. No parameters are required.

Example of use:

```
{% set newsSettings = news_settings() %}
{% if news.cover is not empty %}
    {% set cover = sulu_resolve_media(news.cover.id, 'en' %}

{% else %}
    {% set default = sulu_resolve_media(newsSettings.defaultImage.id, 'en' %}

{% endif %}
```

Contributing
------------

[](#contributing)

You can contribute to this bundle. The only thing you must do is respect the coding standard we implement. You can find them in the `ecs.php` file.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance63

Regular maintenance activity

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~161 days

Recently: every ~119 days

Total

7

Last Release

227d ago

PHP version history (3 changes)2.4.14PHP ^7.4 || ^8.0

2.6.0PHP ^8.0

2.6.2PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2b87043ea111a9f5d76ffa990f48eea6e80576483c7bf33f0dcdd5a899c15c8?d=identicon)[pixeldev](/maintainers/pixeldev)

---

Top Contributors

[![matthieu2607](https://avatars.githubusercontent.com/u/14790414?v=4)](https://github.com/matthieu2607 "matthieu2607 (42 commits)")

---

Tags

sulu-bundlesulusulucms

###  Code Quality

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pixelopen-sulu-newsbundle/health.svg)

```
[![Health](https://phpackages.com/badges/pixelopen-sulu-newsbundle/health.svg)](https://phpackages.com/packages/pixelopen-sulu-newsbundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[sulu/article-bundle

Bundle for managing localized content-rich entities like blog-posts in the Sulu content management system

66409.6k2](/packages/sulu-article-bundle)[shopware/administration

Administration frontend for the Shopware Core

413.9M75](/packages/shopware-administration)[sulu/headless-bundle

Bundle that provides controllers and services for using Sulu as headless content management system

55133.7k2](/packages/sulu-headless-bundle)[sulu/skeleton

Project template for starting your new project based on the Sulu content management system

29733.3k](/packages/sulu-skeleton)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
