限制灵活性文档的内容类型

发布于 2024-12-09 13:49:21 字数 543 浏览 0 评论 0原文

我正在做一个网站,其中有很多不同的文档。他们需要这种方式,因为他们想做各种过滤器等等。

因为它是一家非常大的公司,拥有很多结构,所以他们有一个真正固定的内容层次结构。

这样,只有在某些文件夹中,他们才需要某种内容类型。

我让它工作的唯一成功的方法是创建一个每个内容类型的全局可添加文件夹内容类型,它只允许在其中创建所需的内容类型,而没有其他内容。

因此,在他们的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你与清晨阳光 2024-12-16 13:49:21

不是对你的敏捷问题的直接答案,但是......

仅在某些文件夹中他们需要某种内容类型。

我发现文件夹本地权限对此非常有效。

  • 您不需要任何自定义容器类型 - 只需使用常规文件夹。
  • 理想情况下,每个项目类型都需要自己的添加权限,例如分别针对事物 1 和事物 2 类型的 ACME:添加事物 1ACME:添加事物 2
  • 不要在站点根目录(即在rolemap.xml 中)设置具有权限的角色,而只在需要的文件夹上设置它们。

就是这样。这些内容类型的其余设置与正常情况一样。使它们可全局添加。权限分配意味着它们只能真正添加​​到您选择的特定文件夹中。

如果您不想在该文件夹中添加常用类型(页面、链接等),请关闭相关添加权限的获取。

在这种情况下,可以打破仅使用工作流来管理站点根目录下的权限的(非常明智的)规则。由于很容易忘记您去过的地方,因此我会在 setuphandlers.py 中的代码中设置本地权限,以便清楚地记录哪些文件夹受到影响。

Not a direct answer to your Dexterity question, but...

only inside some folders they want some kind of content types.

I've found folder-local permissions work beautifully for this.

  • You don't need any custom container types - just use regular Folders.
  • Ideally each item type needs its own add permission e.g. ACME: Add Thing 1 and ACME: Add Thing 2 for Thing 1 and Thing 2 types respectively.
  • Rather than set the roles who have the permission at the site root (i.e. in 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文