ezsystems/content-on-the-fly-prototype

平台 UI 内容实时获取功能

安装次数: 187 001

依赖项: 1

建议者: 0

安全性: 0

星标: 5

关注者: 22

分支: 11

语言:JavaScript

类型:ezplatform-bundle

v0.1.12 2018-02-14 10:12 UTC

README

平台 UI 内容实时获取功能

安装

  1. 从您的 eZ Platform 安装中,运行 composer
$ composer require ezsystems/content-on-the-fly-prototype
  1. 通过在 app/AppKernel.php 中添加以下内容来启用该包:
new EzSystems\EzContentOnTheFlyBundle\EzSystemsEzContentOnTheFlyBundle()

  1. 通过在 app/config/routing.yml 中添加包配置来设置路由
_contentOnTheFly:
    resource: "@ContentOnTheFlyBundle/Resources/config/routing.yml"
    prefix:   '%ezpublish_rest.path_prefix%'
  1. 使用 $ composer run-script post-update-cmd 清除缓存并设置资源

    (如果您使用 prod 环境,请确保首先将其设置为 $ export SYMFONY_ENV=prod).

配置

示例应用配置(《app/config/config.yml》)

# ...

content_on_the_fly:
    system:
        site:                       # Configuration per SiteAccess
            content:
                article:            # Content identifier
                    location:
                        - 2         # Suggested location(s)
                default:            # Default, in case of unconfigured content identifier
                    location:
                        - 2
                        - 43

默认包配置

parameters:
    content_on_the_fly.default.content:
        image:
            location:
                - 51    # /Media/Images
        default:
            location:
                - 2     # /Home
                - 43    # /Media

内容类型的默认位置

如果为内容类型(或默认类型)提供了建议位置,则列表中的第一个位置将被预选中。

预选内容类型

要设置内容类型,您必须在 'contentDiscover' 事件的配置中提供 'contentTypeIdentifier'。示例

/**
* ...
* @param config.visibleMethod {String} which tab should be open. Default: 'browse', possible values: 'browse', 'search', 'create'
* @param config.contentTypeIdentifier {String} content type identifier. Default: none, example values: 'image', 'blog', 'article', 'blog_post'
*                                     this parameter is limited to the Create tab, config that works across all tabs will be added in the future
*/
app.fire('contentDiscover', {
    config: {
        // ...
        visibleMethod: 'create',
        contentTypeIdentifier: 'image'
    }
});