如何覆盖drupal中的$ block->内容? [英] how to override $block->content in drupal?

查看:94
本文介绍了如何覆盖drupal中的$ block->内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,如果我想覆盖由Book模块生成的$ block->内容...如何覆盖它并自定义标题列表?谢谢。

解决方案

您可以使用preprocess_block函数

函数phptemplate_preprocess_block(& $ vars){
if(isset($ vars ['block'])){
print_r($ vars);
}
}

并挖掘这些结果。



关于内容,这是一个模块生成的块,我希望 $ content 是渲染器使用 theme()函数,所以你只需要改变它。


Now, if i want to override the $block->content which is generated by the Book module... how can I override it and customize the title list? thank you.

解决方案

You can use the preprocess_block function

function phptemplate_preprocess_block(&$vars) {
  if (isset($vars['block'])) {
      print_r($vars);
    }
  }

And dig into those results.

About the content, is this is a module generated block, I hope that $content is renderer using a theme() function, so you just need to alter it.

这篇关于如何覆盖drupal中的$ block->内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆