限制灵活性文档的内容类型
我正在做一个网站,其中有很多不同的文档。他们需要这种方式,因为他们想做各种过滤器等等。
因为它是一家非常大的公司,拥有很多结构,所以他们有一个真正固定的内容层次结构。
这样,只有在某些文件夹中,他们才需要某种内容类型。
我让它工作的唯一成功的方法是创建一个每个内容类型的全局可添加文件夹内容类型,它只允许在其中创建所需的内容类型,而没有其他内容。
因此,在他们的 FTI 定义中,我有(关于全局可添加文件夹内容类型):
...
<property name="allowed_content_types">
<element value="the.only.desired.contenttype" />
</property>
...
我曾经在“添加新...”下拉列表中看到“限制内容类型”,这对我的情况非常有帮助,因为我有比如 22 个容器和另外 22 种内容类型,而使用“限制内容类型”我只会有 1 个容器和 22 种内容类型。
有什么办法可以在敏捷上做到这一点吗?
I'm doing a website which has lots and lots of different documents. They need them that way because they want to do all kind of filters and so on.
Since it is a really big company with a lot of structure they have a really set in stone hierarchy of content.
That way only inside some folders they want some kind of content types.
The only successful way I made it work was creating a per-content type global addable folderish content type which only allows to create the needed content type inside it and nothing else.
So in their FTI definition I have (on the global addable folderish content type):
...
<property name="allowed_content_types">
<element value="the.only.desired.contenttype" />
</property>
...
I used to see the "Restrict content types" on the "Add new..." dropdown, which would be extremely helpful in my case, since I have like 22 containers and 22 more content types, whereas with that "Restrict content types" I would only have 1 container and 22 content types.
Is there any way to do that on Dexterity?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是对你的敏捷问题的直接答案,但是......
我发现文件夹本地权限对此非常有效。
ACME:添加事物 1
和ACME:添加事物 2
。就是这样。这些内容类型的其余设置与正常情况一样。使它们可全局添加。权限分配意味着它们只能真正添加到您选择的特定文件夹中。
如果您不想在该文件夹中添加常用类型(页面、链接等),请关闭相关添加权限的获取。
在这种情况下,可以打破仅使用工作流来管理站点根目录下的权限的(非常明智的)规则。由于很容易忘记您去过的地方,因此我会在
setuphandlers.py
中的代码中设置本地权限,以便清楚地记录哪些文件夹受到影响。Not a direct answer to your Dexterity question, but...
I've found folder-local permissions work beautifully for this.
ACME: Add Thing 1
andACME: Add Thing 2
for Thing 1 and Thing 2 types respectively.rolemap.xml
), set them only on the Folder where they're required.That's it. The rest of the setup of these content types is as normal. Make them globally addable. The permission assignment means they'll only really be addable in the specific folders you've chosen.
If you don't want the usual types (Page, Link, etc.) addable in that folder, turn off the acquiring of the relevant add permissions.
This is one case where it's ok to break the (very sensible) rule of using only workflow to manage permissions below the site root. Since it's easy to lose track of where you've been, I would set the local permissions in code in my
setuphandlers.py
so there's a clear record of which folders are affected.