将术语表功能限制到站点的特定部分
我们遇到的情况是 Products.PloneGlossary 词汇表的使用应受到内容的限制-type(开箱即用)和路径(术语表仅适用于 /one/part/of/my/plone/site)。有办法做到这一点吗?
We have the case where the usage of the Products.PloneGlossary glossary should be limited by content-type (which is working out of the box) and by path (glossary should be used only for /one/part/of/my/plone/site). Is there a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这似乎是开箱即用的可配置。在 configlet 中,确保“对所有内容全局使用术语表? ”未选中:然后将术语表放在您希望其可用的路径中,并在站点根目录中放置一个空术语表。
This seems configurable out of the box. In the configlet make sure "Use glossaries globally for all content?" is unchecked: then put your glossary in the path where you want it usable, and put an empty glossary at the site root.
那么,您可以克隆内容类型,然后仅在您希望启用词汇表的部分中使用这些内容类型。但我承认,这很不优雅。其他人可能对如何将 PloneGlossary 修改为“placeful”有更好的想法。
Well, you could clone the content types and then use those content types only in the section where you want them Glossary-enabled. But that is pretty inelegant, I admit. Someone else may have a better idea about how to modify PloneGlossary to be "placeful" like this.
如果你在 Plone 4 上,你有一个身体类别“portaltype-xxx”。也许您可以自定义一些词汇表 javascript,仅当该类附加在 BODY 元素上时才运行,几行 jQuery:
if (jq('body').hasClass('portaltype-xxx')) {
...
或者
您可以更改portal_javascript 工具中的glossay javascript 条件,使其仅在object.portal_type=='xxx' 时出现。
祝你好运
If you are on Plone 4 you have a body class "portaltype-xxx". Maybe you can customize a little the glossary javascript, to run only if this class in attached at the BODY element, few lines of jQuery:
if (jq('body').hasClass('portaltype-xxx')) {
...
}
Or you can change the glossay javascript condition in portal_javascript tool to appear only if object.portal_type=='xxx'.
Good luck
不确定 PloneGlossary 是如何工作的,但是您是否尝试使用权限来限制它?使用“共享”选项卡分配允许 PloneGlossary 访问某些文件夹的本地角色...
Not sure how PloneGlossary works, but did you try limiting this with permissions? Use 'sharing' tab to assign local roles that allow PloneGlossary on some folder ...
我认为最简单的解决方案是根据我自己的需要自定义 ploneglossary.js 文件注册的“条件”。我将扩展相关内容类型的架构,并为其提供一个新字段“showGlossary”。条件可以检查对象的值。
这种方法不需要对 PloneGlossary 进行任何自定义,可以直接在我的策略包中完成。
I think the most easy solution is to customize the 'condition' of the registration of the ploneglossary.js file to my own needs. I will extend the schema of the related content-types and give it a new field 'showGlossary'. The condition can the check the value of the object.
This approach does not require any customizations of PloneGlossary and can be accomplished directly inside my policy package.