Php Drupal 7中的块或区域主题
我不知道如何在Drupal7中向区域或块添加自定义主题 这是block--main-column-3.tpl.phpPhp Drupal 7中的块或区域主题,php,drupal,drupal-7,Php,Drupal,Drupal 7,我不知道如何在Drupal7中向区域或块添加自定义主题 这是block--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 clas
<?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;?>
在区域名称中使用下划线。不是破折号
不能在块内容周围包装if语句。无论如何,你不应该也不需要这样做。你是否在你的主题中添加了区域。信息?@MarioAlejandroAraque是的。区块的id是什么?可能问题与您的区块tpl的名称有关。请尝试重命名该模块,例如,对于id为1的块,请重命名block--block-1.tpl.php。@MarioAlejandroAraque是的,这是一种名称。问题的一部分是我在我的区域中使用了破折号而不是下划线。谢谢
<?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; ?>
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