跳转到主要内容

一个灵活的表单,用于编辑内容类型选择字段。

项目描述

Latest Version Egg Status https://img.shields.io/pypi/pyversions/collective.fieldedit.svg?style=plastic:alt:Supported-PythonVersions License

collective.fieldedit

一个用于编辑内容类型选择字段的视图。

功能

  • 只需通过调用一个视图并使用要编辑的字段作为查询字符串参数即可使用

  • 选择要编辑的字段或字段

  • 对于每个字段,您可以选择输入、显示和隐藏

  • 使用与默认编辑表单相同的控件和验证器

  • 尊重模式-hints,如字段权限、不变性和控件

  • 在模态/弹出窗口中使用它,允许编辑一个或多个字段(但不全部)

通过添加到视图的链接 @@field_edit_form 并以查询字符串的形式传递要编辑的字段(最多三个参数,每个字段由一个“:”分隔)来使用它。

示例

编辑文档的文本

http://localhost:8080/Plone/front-page/@@field_edit_form?fields=IRichTextBehavior.text

编辑标题和主题字段

http://localhost:8080/Plone/front-page/@@field_edit_form?fields=IDublinCore.subjects&fields=IDublinCore.title

显示文本并编辑发布日期

http://localhost:8080/Plone/front-page/@@field_edit_form?fields=IRichTextBehavior.text:display:0&fields=IRelatedItems.relatedItems

在模态框中渲染编辑标题的链接

<a href="${python:context.absolute_url()}/field_edit_form?fields=IDublinCore.title"
   class="pat-plone-modal"
   data-pat-plone-modal='{"actionOptions": {"reloadWindowOnClose": false, "redirectOnResponse": true, "disableAjaxFormSubmit": true},
                          "buttons": ".formControls > button"'>
    Edit the Title in a modal
</a>

编辑多个字段

<a href="${python:context.absolute_url()}/@@field_edit_form?fields=field1&amp;fields=field2&amp;fields=field3"
    Edit some fields.
</a>

显示一个字段,编辑另一个

<a href="${python:context.absolute_url()}/@@field_edit_form?fields=field1:display&amp;fields=field2"
    Edit one field, display another.
</a>

隐藏标签

<a href="${python:context.absolute_url()}/@@field_edit_form?fields=field1::0"
    Edit one field, display another.
</a>

添加隐藏字段

<a href="${python:context.absolute_url()}/@@field_edit_form?fields=field1:hidden&amp;fields=field2"
    Edit one field, display another.
</a>

行为字段需要以“Behavior”为前缀

<a href="${python:context.absolute_url()}/@@field_edit_form?fields=IBasic.title"
    Edit one field, display another.
</a>

支持版本

collective.fieldedit已在Plone 5.1、5.2和6上进行了测试。

安装

通过将其添加到您的buildout中安装collective.fieldedit

[buildout]

...

eggs =
    collective.fieldedit

然后运行 bin/buildout

然后转到附加组件控制面板(/prefs_install_products_form)以启用它。

贡献

许可证

该项目受GPLv2许可证的许可。

变更日志

1.0 (2022-06-25)

  • Plone 6.0的附加标记(Bootstrap 5)[jensens]

  • 根据Plone标准使用Black/isort格式化。[jensens]

  • 添加对Python 3、Plone 5.2和6的支持。[pbauer]

1.0a2 (2018-08-04)

  • 修复取消时的重定向和剩余的webdav锁(#1)[pbauer]

1.0a1 (2017-10-10)

  • 首次发布。[pbauer]

项目详情


下载文件

下载适合您平台的文件。如果您不确定要选择哪个,请了解有关 安装包 的更多信息。

源代码分发

collective.fieldedit-1.0.tar.gz (23.1 kB 查看哈希值)

上传时间

由以下机构支持