pixelopen / kirby-news
为 Kirby 4 CMS 添加新闻模块的插件
1.0.3
2023-12-20 10:13 UTC
Requires
- fabianmichael/kirby-meta: ^1.0
- getkirby/cms: ^4.0.0
- getkirby/composer-installer: ^1.1
Requires (Dev)
README
为 Kirby CMS 添加新闻模块的插件
要求
- Kirby >= 4
- PHP >= 8
商业用途
此插件免费
安装
下载
下载文件 并将它们放置在 site/plugins/kirby-news
中。
Composer
composer require pixelopen/kirby-news
Git 子模块
您可以将插件作为 Git 子模块添加。
$ cd your/project/root
$ git submodule add https://github.com/Pixel-Open/kirby-news.git site/plugins/kirby-news
$ git submodule update --init --recursive
$ git commit -am "Add Kirby News plugin"
运行以下命令以更新插件
$ cd your/project/root
$ git submodule foreach git checkout master
$ git submodule foreach git pull
$ git commit -am "Update submodules"
$ git submodule update --init --recursive
初始化
运行您的网站。您应该会看到一个名为“新闻”的新页面。从这个页面您可以创建单个新闻并发布它们。
选项
如果您想使用该块,您需要添加以下行到您的 /site/config/config.php
中的 news
字段集
return [ 'blocks' => [ 'fieldsets' => [ 'custom' => [ 'label' => 'Custom blocks', 'type' => 'group', 'fieldsets' => [ 'news', // Other global custom blocks ] ], 'kirby' => [ 'label' => 'Kirby blocks', 'type' => 'group', 'fieldsets' => [ 'heading', 'text', 'list', 'quote', 'image', 'video', 'code', 'markdown' ] ] ] ] ];
在扩展字段时,您还可以添加自己的字段集,以添加 news
块和您想要使用的所有其他块。