编辑内容类型的选定字段的灵活表单。
collective.fieldedit的Python项目详细描述
collective.fieldedit
编辑内容类型的选定字段的视图。
功能
- 只需调用带有要编辑的字段的视图作为查询字符串参数即可使用
- 选择一个或多个要编辑的字段
- 对于每个字段,您可以在“输入”、“显示”和“隐藏”之间进行选择
- 使用与默认编辑表单相同的小部件和验证器
- 尊重模式提示,如字段权限、不变量和小部件
- 在modals/popups中使用很好,可以编辑一个或多个字段(但不是全部)
通过添加到视图@@field_edit_form的链接来使用它,并将要编辑的字段作为查询字符串传递,每个字段最多有三个由“:”分隔的参数。
示例
编辑文档文本:
http://localhost:8080/Plone/front-page/@@field_edit_form?fields=IRichText.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=IRichText.text:display:0&fields=IRelatedItems.relatedItems
呈现一个链接以在模式中编辑标题:
<a href="${python:context.absolute_url()}/field_edit_form?fields=IBasic.title" class="pat-plone-modal" data-pat-plone-modal='{"actionOptions": {"reloadWindowOnClose": false, "redirectOnResponse": true}, "buttons": ".formControls > button", "content": "#content-core"}'> 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>
行为字段需要以行为作为前缀:
<a href="${python:context.absolute_url()}/@@field_edit_form?fields=IBasic.title" Edit one field, display another. </a>
安装
通过将collective.fieldedit添加到构建中来安装它:
[buildout] ... eggs = collective.fieldedit
然后运行bin/buildout
贡献
1.0a2(2018-08-04)
- 修复取消时的重定向和剩余WebDAV锁定(1) [PBAUER]
1.0a1(2017-10-10)
- 初次发布。 [PBAUER]