arter/amos-news
AMOS新闻系统
Requires
- php: >=5.4.0
- 2amigos/yii2-ckeditor-widget: ~1.0
- arter/amos-admin: ^2.2.0
- arter/amos-attachments: ^1.1.11
- arter/amos-comments: ^1.1
- arter/amos-core: ^1.15.0
- arter/amos-dashboard: ^1.8.4
- arter/amos-notify: ^1.4.13
- arter/amos-report: ^1.0.5
- arter/amos-seo: *
- arter/amos-workflow: ^1.0.5
- cornernote/yii2-workflow-manager: *
- kv4nt/yii2-owl-carousel2: *
- raoul2000/yii2-workflow: *
- raoul2000/yii2-workflow-view: *
- yiidoc/yii2-redactor: *
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-07 11:41:54 UTC
README
新闻管理。
安装
您需要在您的配置中要求此软件包并启用模块。
在 composer.json 中添加到 composer 要求
"arter/amos-news": "dev-master",
或运行以下命令 bash
composer require "arter/amos-news:dev-master"
在 modules-amos.php 中启用新闻模块,添加
'news' => [
'class' => 'arter\amos\news\AmosNews',
],
将新闻迁移添加到控制台模块(console/config/migrations-amos.php)
'@vendor/arter/amos-news/src/migrations'
如果您的项目使用前端或公共网站,并且新闻需要在后台之外可见,请启用表单/向导字段以允许在前端/主页上发布,并使用参数
'news' => [
'class' => 'arter\amos\news\AmosNews',
'params' => [
'site_publish_enabled' => true,
'site_featured_enabled' => true
]
],
内容适合与cwh内容管理一起使用。要这样做
- 激活cwh插件
- 打开cwh配置向导(需要管理员权限)url
- 在内容配置部分搜索新闻
- 编辑新闻配置并保存
如果需要标签,请在 "modules-amos.php" 中启用此模块(主项目中的 backend/config 文件夹)在标签部分。之后,在标签管理器中启用树。
如果平台使用报告和/或评论,并且您想启用新闻被评论/报告内容,请将模型添加到 modules-amos.php 中的配置
用于报告
'report' => [
'class' => 'arter\amos\report\AmosReport',
'modelsEnabled' => [
.
.
'arter\amos\news\models\News', //line to add
.
.
]
],
用于评论
'comments' => [
'class' => 'arter\amos\comments\AmosComments',
'modelsEnabled' => [
.
.
'arter\amos\news\models\News', //line to add
.
.
],
],
可配置字段
以下为可配置字段列表,AmosNews模块的属性。如果某些属性的默认值不适合您的项目,您可以在模块中配置它,例如
'news' => [
'class' => 'arter\amos\news\AmosNews',
'validatePublicationDate' => false, //changed property (default was true)
],
validatePublicationDate - 布尔值,默认 = true
如果此属性为 true,则激活发布日期的验证。
默认情况下,您只能验证发布日期大于或等于今天的新闻。
设置为 false 以允许对发布日期小于今天的新闻进行验证。filterCategoriesByRole - 布尔值,默认 = false
如果为 true,则通过新闻_category_roles_mm 表启用分类角色检查。
默认情况下,新闻分类对所有用户可用。
如果分类与rbac角色相关联,请填充 'news_category_roles_mm' 表,并将配置中的模块属性 filterCategoriesByRole 设置为 true
'news' => [
'class' => 'arter\amos\news\AmosNews',
'filterCategoriesByRole' => true
]
hidePubblicationDate - 布尔值,默认 = false
创建的新闻总是可见的,隐藏字段 publication_from,publication_tonewsRequiredFields - 数组,默认 = ['news_categorie_id', 'titolo', 'status', 'descrizione_breve']
新闻表单中的必填字段:默认情况下,新闻分类、标题和状态是必填的。
如果您的平台中,例如,您不想将标题作为必填字段,则按以下方式覆盖 newsRequiredFields 属性'news' => [ 'class' => 'arter\amos\news\AmosNews', 'newsRequiredFields' => ['news_categorie_id', 'status'] ],
defaultCategory - 整数 新新闻预选默认类别的ID
'news' => [ 'class' => 'arter\amos\news\AmosNews', 'defaultCategory' => 3 ],
autoUpdatePublicationDate - 布尔值,默认 = false
此设置在保存时自动更新发布日期,如果新闻已发布'news' => [ 'class' => 'arter\amos\news\AmosNews', 'autoUpdatePublicationDate' => true ],
$enableCategoriesForCommunity - 布尔值,默认 = false
- $showAllCategoriesForCommunity - 布尔值,默认 = false
- $whiteListRolesCategories - 默认 = ['ADMIN', 'BASIC_USER']