Drupal - 将内容分解为不同的内容(每 12 个产品后,显示一个广告?)

发布于 2024-09-04 02:55:19 字数 126 浏览 7 评论 0原文

目前,我有一个 T 恤网站的主页,其中列出了 4 列网格,每个单元格包含网站上的所有衬衫(使用视图)。客户希望每隔几行显示一个广告(可能是随机视图/阻止项目)。这可能吗?我确信我最终需要将网格显示设置为其他内容,但我该如何对其进行编程呢?

Currently I have the homepage of a t-shirt site list a 4 column grid, each cell containing all the shirts on the website (using views). The client would like every few rows to display an ad (perhaps a random view/block item). Is this possible? I'm sure I will end up needing to set the grid display to something else but how could I program this in?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

橘味果▽酱 2024-09-11 02:55:19

这可以通过使用视图模板来实现。

在您的视图显示中,您可以创建自定义 tpl 文件。这些可以在主题部分找到(单击信息)。

如果您在 tpl 样式的 foreach 循环中添加计数,那么在 $i 达到某个数字后,您就可以打印广告或自定义文本。

This would be achievable by using views templates.

In your view display you can create custom tpl files. These can be found in the theme section (click on Information).

If you add a count to the foreach loop in the style tpl then after $i hits a certain number you can then print your ad or custom text.

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