1

我有一个名为fund的内容类型。

其内容在 page.tpl.php 内的 node-fund.tpl.php 中

我需要重新创建基金的内容,但没有 page.tpl.php

所以要清楚,我需要有2页

1) 基金内页模板 2) 基金数据但完全重新格式化。计划是创建在 A4 上打印良好的页面

关于我如何实现这一目标的任何想法。

4

2 回答 2

1

您是如何创建基金内容类型的?CCK、自定义模块或只是一个简单的新内容类型(即管理 > 内容管理 > 内容类型 > 添加内容类型)。AFAIK 每种方法都有不同的可能性。

一种选择是创建一个 print.css 文件,该文件在将网页发送到打印机时使用。查看CSS Design: Going to Print将是一个很好的起点。

我希望这有帮助。

于 2009-06-28T13:22:35.303 回答
0

在 template.php preprocess___page() 中,您可以在 URL 上查找 /print 并使用 $vars['template_files'] 更改模板。

这里抄袭

 function phptemplate_preprocess_page(&$vars) {
  if (module_exists('path')) {
    $alias = drupal_get_path_alias(str_replace('/edit','',$_GET['q']));
    if ($alias != $_GET['q']) {
      $suggestions = array();
      $template_filename = 'page';
      foreach (explode('/', $alias) as $path_part) {
        $template_filename = $template_filename . '-' . $path_part;
        $suggestions[] = $template_filename;
      }
      $vars['template_files'] = array_merge((array) $suggestions, $vars['template_files']);
    }
  }
}
于 2009-06-29T09:48:52.710 回答