【问题标题】:How to make Drupal 6 print Region DIV wrappers如何制作 Drupal 6 打印区域 DIV 包装器
【发布时间】:2012-01-13 16:25:14
【问题描述】:

我正在使用上下文将块打印到区域中。但是,我想让区域打印包装器 DIV 围绕给定区域的块。我知道这在 Drupal 7 中使用 region.tpl.php 是可能的。我似乎无法找出 Drupal 6 中的最佳方法。

 <div class="{region classes i.e. sidebarleft}">
      <div class="{block 1}"></div>
      <div class="{block 2}"></div>
      <div class="{block 3}"></div>
      <div class="{block 4}"></div>
 </div>

但是,目前它的打印方式如下:

<a id="context-block-region-right" class="context-block-region">Right Sidebar</a>
      // the previous anchor tags is hidden
      <div id="block-block-82" class="clear-block block block-block">
           <h2>Community Navigation Block</h2>
                <div class="content">
                <div id="community-landing-navigation-menu">
                <div class="joinCommunityBox">
                <div class="community-landing-pagePanelWrapperSideBar">
                <div class="community-landing-pagePanelWrapperSideBar">
           <a id="context-block-block-82" class="context-block editable edit-community_contexts"></a>
 </div>
 </div>

我希望它会在所有这些周围打印一个区域包装标签...

另外,我想让我的 page.tpl.php 中没有多余的包装标签。如果我们可以预处理区域以打印包装标签会更好。

【问题讨论】:

  • 恐怕在 Drupal 6 中将额外的包装标签放在 page.tpl.php 实现此目的的首选(也许是唯一的)方法。
  • 我想通了……答案其实是从禅宗那里借来的。如果您单击下面的链接,几个预处理函数正在渲染一个新的区域模板。然后,将块收集到该区域并打印。 drupal.org/node/223440#comment-5304866
  • 我已更正 :) 感谢您的链接。您应该发布带​​有简短描述的链接作为答案,它可能对将来的某人非常有用

标签: html drupal regions


【解决方案1】:

我想通了...答案实际上是从禅宗那里借来的。如果您单击下面的链接,几个“预处理函数”正在呈现一个新的区域模板。然后,将块收集到该区域并打印。

http://www.drupal.org/node/223440#comment-5304866

效果很好,很快就会投入生产。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 1970-01-01
    • 1970-01-01
    • 2012-02-14
    • 1970-01-01
    相关资源
    最近更新 更多