我有一个Drupal过滤器模块,我希望改变输出,具体取决于输出的显示位置。具体来说,我希望过滤器为节点提供完整的输出,但是为内容减少内容。
答案 0 :(得分:1)
我不认为这是可能的。很难弄清楚显示的内容是什么。这是可行的,但很难自己编码。然而,过滤系统的工作方式我不认为它可能在过滤器中确定被过滤文本的上下文。它根本就不是为了这样的东西。
答案 1 :(得分:0)
我是OP(但刚刚注册了一个帐户)。
我确实找到了解决方案/解决方法。这是我做的:
function hook_theme_registry_alter(&$theme_registry) { // using our own block.tpl.php file. $theme_registry['block']['template'] = 'block'; $theme_registry['block']['path'] = drupal_get_path('module', 'module_name'); $theme_registry['block']['type'] = 'module'; $theme_registry['block']['theme path'] = drupal_get_path('module', 'module_name'); $theme_registry['block']['theme paths'] = Array(); }