一个灵活的表单,用于编辑内容类型选择字段。
项目描述
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&fields=field2&fields=field3"
Edit some fields.
</a>
显示一个字段,编辑另一个
<a href="${python:context.absolute_url()}/@@field_edit_form?fields=field1:display&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&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的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 53a2dbdf9f1e771c10bc598ad78d8a9acc4853ae34850c3d466943a6cd6432bd |
|
MD5 | 8f0a52f9ee3f9f6e71a747d629fb7a7a |
|
BLAKE2b-256 | 71de7f78ee1a77ab58aa56465a38147420beb6b4b7e08b20350e78316327a2ad |