如何制作 Drupal 6 打印 Region DIV 包装纸

发布于 2024-12-27 01:21:29 字数 1288 浏览 4 评论 0原文

我正在使用上下文将块打印到一个区域中。但是,我希望区域在给定区域的块周围打印包装器 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>

我希望它能在 ALL 周围打印一个区域包装器标记那...

另外,我想保持我的 page.tpl.php 没有额外的包装标签。如果我们可以预处理区域来打印包装标签,那就更好了。

I'm using context to print blocks into a region. However, I'd like to have the region print wrapper DIVs around the blocks of the given area. I know this is possible with region.tpl.php in Drupal 7. I can't seem to figure out the best way in 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>

However, currently it prints like this:

<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>

I wish it would print a region wrapper tag around ALL of that...

Also, I want to keep my page.tpl.php clean of extra wrapper tags. It would be better if we could preprocess regions to print a wrapper tag.

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

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

发布评论

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

评论(1

允世 2025-01-03 01:21:29

我想通了……这个答案其实是借自禅宗的。如果您单击下面的链接,多个“预处理函数”正在渲染新的区域模板。然后,块被收集到该区域并打印。

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

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

I figured it out... The answer is actually borrowed from zen. If you click the link below, several 'preprocess functions' are rendering a new region template. Then, blocks are collected into that region, and printed.

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

It works great, and is going to go production soon.

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