自定义块的主题不起作用

时间:2015-08-13 08:17:59

标签: php drupal drupal-7 drupal-blocks

我一直关注这篇文章

http://legomenon.io/article/drupal-7-creating-theming-custom-block-content

所以我做了相应的,

我有这些,顺便说一句,我的自定义模块是 efq_story_list

HOOK_THEME

function efq_story_list_theme() {
  return array(
    'efq_story_list_function_items' => array(
       'variables' => array('items' => NULL),
       'template' => 'templates/efq_story_list--block'
    ),
  );
}

生成列表的功能

function __efq_story_list_block_content() {
   #SOME CODE HERE and variable $items has the list
   return theme("efq_story_list_function_items", array("items" => $items));
}

HOOK_BLOCK_VIEW

块名称为opinion

function efq_story_list_block_view($delta = ''){
  switch ($delta) {
    case 'opinion':
        $block['content'] = __efq_story_list_block_content();
        break;
  } 
  return $block;
}

然后在我的templates/efq_story_list--block我有文件efq_story_list--block.tpl.php ..然后我刷新所有缓存,

但现在我得到了WSOD。我在本地机器和它的工作中试过这个,所以我想知道我的生产网站还有什么我可以错过的...非常感谢..我对drupal很新,所以我不知道在哪里看...

编辑#1

模板文件的内容是

<?php $items = $variables['items']; ?>

<div class="row">
    <?php foreach($items as $item): ?>
        <div class="col-md-3 news_list panel">
            <div class='thumbnail_wrapper'>
                <a href="<?php print render($item['path']); ?>"><img src="print render($item['image_url']);" /></a>
            </div>
            <div class="meta small_sprite">
                <span class="generic icon source_<?php print render($item['source_class']); ?>"></span>
                <span><?php print render($item['source']); ?></span>
            </div>
            <div class="caption">
                <a href="<?php print render($item['path']); ?>"><?php print render($item['title']); ?></a>
            </div>
        </div>
    <?php endforeach;
</div>

0 个答案:

没有答案
相关问题