2015-09-24 78 views
0

我有ABLOCK模板在我的Drupal 7

文件block.tpl.php是这样的:

<?php print render($title_prefix); ?> 
 
<?php if ($block->subject): ?> 
 

 
<h3<?php print $title_attributes; ?>><?php print $block->subject ?></h3> 
 

 
<?php endif;?> 
 
<?php print render($title_suffix); ?> 
 
    
 
<li class="leftMenu_goPortal_options" style="display: list-item;"> 
 
<ul class="gn-submenu"> 
 

 
print $content_attributes; ?> 
 
<?php print $content ?> 
 

 
</ul> 
 
</li>

我想更改$ content变量,因为我在网站上的内容区域都是像ul或li。

我需要有2个变量,一个用于块内容,另一个用于网站内容。

TNX!

+0

你想这样做,修改为所有的块或在一个格外? – Fky

回答

0

block.tpl.php中的$ content只包含该块的内容。如果你想查看当前页面的html,你可以使用page.tpl.php,其中的区域和块被打印出来。

0

使用hook_preprocess_HOOK

function THEME_preprocess_block(&$variables) { 
. 
. 
. 
//change $variables['content'] as needed 
. 
. 
}