0

我正在使用 simplenews 模块来为 post simplenews 模块提供一个块部分的多个订阅,但我需要更改设计布局。

4

1 回答 1

1

这是“function template_preprocess_block(&$variables)”代码的一部分

  $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->region;
  $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->module;
  // Hyphens (-) and underscores (_) play a special role in theme suggestions.
  // Theme suggestions should only contain underscores, because within
  // drupal_find_theme_templates(), underscores are converted to hyphens to
  // match template file names, and then converted back to underscores to match
  // pre-processing and other function names. So if your theme suggestion
  // contains a hyphen, it will end up as an underscore after this conversion,
  // and your function names won't be recognized. So, we need to convert
  // hyphens to underscores in block deltas for the theme suggestions.
  $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->module . '__' . strtr($variables['block']->delta, '-', '_');

您可以在主题中将一些建议创建为 .tpl 文件,或者只是在主题中创建一个基本的 block.tpl.php

于 2013-09-27T10:46:49.797 回答