如何使用“剖面图”可由用户添加?
我需要设置一个可由用户添加的“部分图像”。 客户希望网站顶部的每个文件夹都有不同的图像。 这些图像可以由门户用户添加/编辑。
通常我将 Collective.contentleadimage 添加到实例中。然后,我创建一个新的视图,使用 aq_parent 自定义 contentleadimage 代码,以便为没有自己的“部分图像”的文件夹提供“遍历方式”。这样,所有第一级文件夹都可以有一个“截面图像”,第二级文件夹可以有一个由父文件夹继承的“截面图像”。
有更好的办法吗?
维托
I need to setup a "section image" addable by a user.
The customer wants a different image for every folder placed in the top of the site.
These images can be added/edited by portal user.
Usually I add collective.contentleadimage to the instance. Then I create a new viewlet customizing the contentleadimage code using the aq_parent to have a "traversal way" for folders without a own "section image". In this way all the first-level folders can have a "section image" and the second one a "section image" inherited by the parent folder.
Is there a better way?
Vito
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您需要客户可以修改图像,那么您所说的“遍历方式”是最简单的选择。
另一种选择可能是依赖portal_registry:
The "traversal way", as you call it, is the simplest option if you need that the image is modifiable by the customer.
Another option could be to rely on the portal_registry: