kotaru/sulu-news-bundle
最新稳定版本:1.0.0
Composer 安装命令:
composer require kotaru/sulu-news-bundle
包简介
Simple News Bundle for Sulu 2 CMS
README 文档
README
PHP 8.3+, Sulu 2.6, Symfony 7.4+
Installation
This bundle requires PHP 8.3 or later.
- Open a command console, enter your project directory and run:
composer require kotaru/sulu-news-bundle
You'll also need to add the bundle in your config/bundles.php file:
return [ //... Kotaru\Bundle\SuluNewsBundle\SuluNewsBundle::class => ['all' => true], ];
- Register the new routes by adding the following to your
config/routes/sulu_news_admin.yaml:
sulu_news_api: resource: "@SuluNewsBundle/Resources/config/routing_api.yaml" prefix: /admin/api
- Add following config to your
config/image-formats.xml:
<format key="article-header"> <meta> <title lang="cs">Úvodní obrázek článku (2100x900)</title> <title lang="en">Article Header (2100x900)</title> </meta> <scale x="2100" y="900" mode="outbound" /> </format>
-
Create a template in your
templates/news/index.html.twig: -
Enjoy the new features of your Sulu installation!
Extras
/admin/api/check/news/{uuid}endpoint for checking user permissions to edit this news page.
Twig extensions
Functions
get_related_news
Arguments:
uuid: page uuidlocale: locale to resolve news forlimit: how many news to load
Returns a list of related news with given locale
Usage:
{{ get_related_news('4afdde53-917b-40d2-aed7-3d74c485c39c','en',3) }}
Result:
[news1,news2,news3]
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-09