drupal块显示

发布于 2024-09-08 10:20:22 字数 155 浏览 1 评论 0原文

有没有办法将块放置在不同区域而不重复。例如,考虑一个 block1 及其显示区域要求,

  page1 lefttop
  page2 right

如何在 2 个不同的区域中配置 block1?

is there any way to place a block in different regions without duplicating it . for ex consider a block1 and its display regions requirement

  page1 lefttop
  page2 right

how to configure block1 in 2 different regions ?

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

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

发布评论

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

评论(3

余厌 2024-09-15 10:20:22

据我了解,每个块都必须是唯一的,因此使用标准块管理,一个块不能同时位于两个位置。

话虽如此,块本质上只是一个函数调用,因此您可以通过编程方式绕过此限制。使用类似 drupal_set_content() 的内容。我真的不会走这条路,因为你可能会遇到一些意想不到的、令人讨厌的后果。

然而,您可能想要的是 Multi Block 之类的东西。

As far as I understand it each block has to be unique, so a block cant be in two places at once using the standard block admin.

Having said that a block is essentially just a function call, so you can get around this limitation programmatically. using something like drupal_set_content(). I really wouldn't take this route though as you will probably run into some unintended and nasty consequences.

However what you probably want is something like Multi Block.

慕烟庭风 2024-09-15 10:20:22

使用 Drupal 块系统则不能,如果您希望同一个块出现在多个区域中,则需要复制该块。这是当前块系统的限制之一,我不确定它在 Drupal 7 中是否有所改变。

这是面板解决的问题之一,但仅使用它来解决这个问题,有点矫枉过正。

With the Drupal block system you can't, if you want the same block to appear in more than one region, you'll need to duplicate the block. That is one of the limitations the current block system has, I'm not sure if it's changed in Drupal 7.

This is one the of the things that Panels solves, but to use it only to solve this problem, would be a bit overkill.

蓝眼泪 2024-09-15 10:20:22

在 Drupal 8.x 中这个问题得到了解决:
http://drupal.org/node/79571

但是,对于 Drupal 6.x 和 Drupal 7.x,您可以使用以下方式:
http://drupal.org/node/353565

In Drupal 8.x this problem solved:
http://drupal.org/node/79571

But, for Drupal 6.x and Drupal 7.x you can used this way :
http://drupal.org/node/353565

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