写一个单独的头文件会更容易......如果你打开catalog/controller/common/home.php
你会发现以下代码
$this->children = array(
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);
你可以把它改成
$this->children = array(
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/headerhome'
);
然后打开:
catalog/view/theme/default/common/home.tpl
并找到以下行:
<?php echo $header; ?>
并将其更改为:
<?php echo $headerhome; ?>
然后复制:
catalog/controller/common/header.php
并重命名
headerhome.php
然后打开
catalog/controller/common/headerhome.php
并找到以下行
class ControllerCommonHeader extends Controller {
并更改为:
class ControllerCommonHeaderhome extends Controller {
然后找到:
$this->language->load('common/header');
并更改为:
$this->language->load('common/header');
然后找到以下代码:
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/header.tpl';
} else {
$this->template = 'default/template/common/header.tpl';
}
并将其更改为:
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/headerhome.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/headerhome.tpl';
} else {
$this->template = 'default/template/common/headerhome.tpl';
}
然后复制
catalog/view/theme/default/common/header.tpl
并重命名为:
catalog/view/theme/default/common/headerhome.tpl
然后复制:
catalog/language/english/common/header.php
并重命名为:
catalog/language/english/common/headerhome.php
然后,您可以编辑以下文件以反映您想要的样式更改:
catalog/view/theme/default/common/headerhome.tpl
然后,您可以编辑以下文件以反映所需的语言更改:
catalog/language/english/common/headerhome.php
这意味着主页将显示 headerhome 并且所有其他页面将显示标准标题,如果您像之前所说的那样只有两个页面,这可以解决您的问题...