dmstr / yii2-publication-module
出版物模块
1.3.0-beta3
2023-06-13 13:38 UTC
Requires
- 2amigos/yii2-translateable-behavior: ^1.0.4
- dmstr/yii2-json-editor: ^1.0.0
- dmstr/yii2-widgets2-module: ^2.0.0
- insolita/yii2-adminlte-widgets: ~1.1
- kartik-v/yii2-widget-select2: ^2
- yiisoft/yii2: *
- yiisoft/yii2-twig: ^2.0.4
- zhuravljov/yii2-datetime-widgets: ~1.1.0
- dev-master
- 1.3.0-beta3
- 1.3.0-beta2
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.0
- 1.0.0-rc3
- 1.0.0-rc2
- 1.0.0-rc1
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.5.0-alpha66
- 0.5.0-alpha65
- 0.5.0-alpha64
- 0.5.0-alpha63
- 0.5.0-alpha62
- 0.5.0-alpha61
- 0.5.0-alpha60
- 0.5.0-alpha59
- 0.5.0-alpha58
- 0.5.0-alpha57
- 0.5.0-alpha56
- 0.5.0-alpha55
- 0.5.0-alpha54
- 0.5.0-alpha53
- 0.5.0-alpha52
- 0.5.0-alpha51
- 0.5.0-alpha50
- 0.5.0-alpha49
- 0.5.0-alpha48
- 0.5.0-alpha47
- 0.5.0-alpha46
- 0.5.0-alpha45
- 0.5.0-alpha44
- 0.5.0-alpha43
- 0.5.0-alpha42
- 0.5.0-alpha41
- 0.5.0-alpha40
- 0.5.0-alpha39
- 0.5.0-alpha38
- 0.5.0-alpha37
- 0.5.0-alpha36
- 0.5.0-alpha35
- 0.5.0-alpha-34
- 0.5.0-alpha33
- 0.5.0-alpha32
- 0.5.0-alpha31
- 0.5.0-alpha30
- 0.5.0-alpha29
- 0.5.0-alpha28
- 0.5.0-alpha27
- 0.5.0-alpha26
- 0.5.0-alpha25
- 0.5.0-alpha24
- 0.5.0-alpha23
- 0.5.0-alpha22
- 0.5.0-alpha21
- 0.5.0-alpha20
- 0.5.0-alpha19
- 0.5.0-alpha18
- 0.5.0-alpha17
- 0.5.0-alpha16
- 0.5.0-alpha15
- 0.5.0-alpha14
- 0.5.0-alpha13
- 0.5.0-alpha12
- 0.5.0-alpha11
- 0.5.0-alpha10
- 0.5.0-alpha9
- 0.5.0-alpha8
- 0.5.0-alpha7
- 0.5.0-alpha6
- 0.5.0-alpha5
- 0.5.0-alpha4
- 0.5.0-alpha3
- 0.5.0-alpha-2
- 0.5.0-alpha1
- 0.4.5-beta1
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.1
- 0.1.0
- dev-feature/main-filter-rework
- dev-feature/tag-groups
- dev-feature/audit-trail-behavior
- dev-feature/model-version-tab
- dev-feature/item-start-and-end-date
- dev-feature/ensure-array
- dev-dev/fix-item-status-default
- dev-feature/detail-title
- dev-feature/update-composer-dependencies
- dev-feature/fix-pg-migration
- dev-feature/postgres-support
- dev-dev/bug-fix-cleanup
- dev-feature/enable-di-overload
- dev-dev/better-interface
- dev-feature/twig-2
This package is auto-updated.
Last update: 2024-09-14 16:01:04 UTC
README
出版物模块
安装
安装此扩展的首选方式是通过composer。
运行以下命令之一
php composer.phar require --prefer-dist dmstr/yii2-publication-module "*"
或
"dmstr/yii2-publication-module": "*"
将以下内容添加到你的composer.json
文件的require部分
{
"type": "vcs",
"url": "https://git.hrzg.de/dmstr/yii2-publication-module.git"
}
和repositories部分:
配置
扩展安装后,只需在代码中添加两个模块到配置文件中的module部分即可使用。
'modules' => [ 'publication' => [ 'class' => dmstr\modules\publication\Module::class, 'previewItemRole' => null // This describes a rbac role which allowed the user which has grants for this privilege to access the default detail action even if the item is not published ] ]
从@dmstr/modules/publication/migrations
运行迁移。
使用方法
为摘要创建widget-templates /widgets/crud/widget-template/index
。
{
"title": "News Teaser",
"type": "object",
"properties": {
"teaser": {
"type": "string",
"title": "Teaser",
"default": "subline"
}
}
}
并为内容创建。
{
"title": "News Content",
"type": "object",
"properties": {
"content": {
"type": "string",
"title": "Content",
"default": "Content"
}
}
}
创建一个分类,例如新闻
,并将模板分配给它。
创建一个条目。
publication/default/index?categoryId=1
在摘要模板中使用内容架构中的变量
{{ content.headline }}
{{ content.image }}