eab/relatednodesbundle

eZ Publish 相关节点数据类型包

0.9.0 2015-12-20 12:52 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:26:49 UTC


README

摘要

eZ Publish 5 包,提供了一个非常简单的相关节点(相关位置)数据类型。

使用相关节点数据类型的字段可以通过Symfony栈访问或显示。要编辑它们,您需要使用旧栈。

此数据类型不会检查位置/节点是否存在或当前用户可以访问。您需要编写自己的代码来执行此操作。

更多文档

版权

版权(C)2015 Enterprise AB Ltd

许可

许可协议为GNU通用公共许可证2.0

要求

需要eZ Publish 5。

安装

  1. 使用composer将包安装到vendors

     composer require --update-no-dev --prefer-dist eab/relatednodesbundle
    

    或者如果您想修改包,请使用git将包克隆到src

     git clone https://github.com/eab-dev/EabRelatedNodesBundle.git src/Eab/RelatedNodesBundle
    
  2. 编辑文件ezpublish/EzPublishKernel.php,查找函数registerBundles()并添加

     new Eab\RelatedNodesBundle\EabRelatedNodesBundle(),
    
  3. 运行(在Windows上您应该是管理员才能创建符号链接)

     php ezpublish/console ezpublish:legacybundles:install_extensions
     php ezpublish/console ezpublish:legacy:script bin/php/ezpgenerateautoloads.php
     php ezpublish/console cache:clear --no-warmup --env=prod
    
  4. 使用eZ Publish的admin界面添加一个使用此数据类型的字段到内容类型并创建一些内容。

  5. 在Twig模板中使用ez_render_field测试它。基本用法如下

     <div>
         {{ ez_render_field( content,
                             'my_related_node_field',
                             {
                                 'parameters': {
                                                 'viewType': 'line'
                                               }
                             } ) }}
     </div>