如何在Plone 5中添加新的收集条件? [英] How to add new collection criteria in Plone 5?

查看:105
本文介绍了如何在Plone 5中添加新的收集条件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个新创建的实例中向Dexterity Content Type File添加了一个名为course的新选择字段.为了将课程"字段用作/++ add ++ Collection中的条件,我遵循

I add a new choice field named course to Dexterity Content Type File in a new created instance. In order to use the field "course" as criteria in /++add++Collection, I follow this guide and add these to the file registry.xml in plone/buildout-cache/eggs/plone.app.querystring-1.3.14-py2.7.egg/plone/app/querystring/profiles/default/registry.xml:

<records interface="plone.app.querystring.interfaces.IQueryField"
       prefix="plone.app.querystring.field.course">
<value key="title">course</value>
<value key="description">A custom course index</value>
<value key="enabled">True</value>
<value key="sortable">False</value>
<value key="operations">
    <element>plone.app.querystring.operation.string.is</element>
</value>
<value key="group">Metadata</value>
</records>

但是我在条件列表中找不到课程".

But I can not find "course" in criteria list.

我该怎么做才能获得此收集标准?

What can I do to get this criteria for collection?

推荐答案

首先:修改Plone源代码是一种不好的做法.不要这样永远不会.

First of all: modify the Plone source code is a bad practice. Don't do it. Never.

您所指的指南是可以的,但它必须在必须开发并添加到安装的新Plone附件中使用.

The guide you are referring to is OK, but it's intended to be used in a new Plone add-on you must develop and add to your installation.

请阅读开发Plone插件"指南.

在您的情况下:您需要一个非常简单的加载项,并具有一个简单的通用设置步骤,该步骤包含一个包含上面代码的registry.xml文件. 安装附加组件之后(每次您将其重新安装时),您的注册都将添加到您的站点中.

In your case: you need a really simple add-on with a simple generic setup step that contains a registry.xml file with your code above. After installing the add-on (and every time you will reinstall it) your registration will be added to your site.

这篇关于如何在Plone 5中添加新的收集条件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆