如何使用“剖面图”可由用户添加?

发布于 2024-12-15 06:04:16 字数 273 浏览 4 评论 0原文

我需要设置一个可由用户添加的“部分图像”。 客户希望网站顶部的每个文件夹都有不同的图像。 这些图像可以由门户用户添加/编辑。

通常我将 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 技术交流群。

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

发布评论

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

评论(1

浪菊怪哟 2024-12-22 06:04:16

如果您需要客户可以修改图像,那么您所说的“遍历方式”是最简单的选择。

另一种选择可能是依赖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:

  • add an image anywhere you like
  • add an entry in the registry where you specify the location of the image for a specific section
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文