简体   繁体   English

区域主题在Drupal 7中

[英]Block or region themes in Drupal 7

I can't figure out how to added a custom theme to a region or block in Drupal 7. 我不知道如何在Drupal 7中向区域或块添加自定义主题。

This is block--main-column-3.tpl.php 这是块--main-column-3.tpl.php

<?php if ($block->subject): ?>
    <h2><a href="what-is-nations.html#jobs"><?php print $block->subject ?></a></h2>
<?php endif;?>

<div class="info-graph-section income">
    <object type="image/svg+xml" data="<?php print path_to_theme(); ?>/images/income.svg">
        <!-- fallback image in CSS -->
    </object>
</div>

<?php if ($block->content): ?>
    <?php print $content ?>
    <p><a href="what-is-nations.html#jobs">Learn More <i class="fa fa-chevron-right"></i></a></p>
<?php endif;?>

This is page.tpl.php 这是page.tpl.php

<?php if($page["main-column-3"]): ?>
    <div class="col-lg-4 col-sm-4">
        <?php print render($page["main-column-3"]) ?>

<div class="info-graph-section housing">
    <object type="image/svg+xml" data="<?php print path_to_theme(); ?>/images/housing.svg">
        <!-- fallback image in CSS -->
    </object>
</div>

    </div>
<?php endif; ?>

It gets rendered but it's not using my theme. 它被渲染,但是没有使用我的主题。

I have a region called content-column-3 and I have a block in that region. 我有一个名为content-column-3的区域,并且在该区域有一个方块。

What's the step that I'm missing here? 我在这里错过了什么步骤?

Thanks. 谢谢。

Edit: 编辑:

I'm trying to put the content below the image while keeping the title above the image. 我试图将内容放在图像下方,同时将标题保持在图像上方。 This is what it looks like now 这就是现在的样子

在此处输入图片说明

Edit: .info 编辑:.info

name = Nations
description = Nations Drupal Theme
core = 7.x

stylesheets[all][] = css/bootstrap.css
stylesheets[all][] = css/custom-styles.css



regions[content] = Content

regions[content-header] = Content Header
regions[content-main] = Content Main

regions[main-column-1] = Main Column 1
regions[main-column-2] = Main Column 2
regions[main-column-3] = Main Column 3

regions[footer-column-1] = Footer Column 1
regions[footer-column-2] = Footer Column 2
regions[footer-column-3] = Footer Column 3

regions[footer-copyright] = Footer Copyright

features[] = main_menu

Use underscores in your region names. 在您的区域名称中使用下划线。 Not dashes. 不破折号。

You can't wrap an if statement around your block content. 您不能将if语句包装在块内容周围。 You shouldn't want or need to anyway. 无论如何,您都不需要或不需要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM