我们以About Us为例讲解一下zencart中如何新建页面!
1.在includes\languages\english\html_includes目录中新建文件define_about_us.php
2.在includes\templates\Your_template\templates目录中新建文件 tpl_about_us_default.php
并在此文件中增加如下代码:
<div id=”aboutUs”>
<h1 id=”aboutUsHeading”><?php echo HEADING_TITLE; ?></h1>
<div id=”aboutUsMainContent”>
<?php
require($define_page);
?>
</div>
<div><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . ‘</a>’; ?></div>
</div>
3.在includes\modules\pages目录中新建about_us目录
4.在新建的about_us目录中新建文件header.php,并在文件中增加如下代码:
<?php
require(DIR_WS_MODULES . zen_get_module_directory(‘require_languages.php’));
$breadcrumb->add(NAVBAR_TITLE);
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . ‘/html_includes/’, FILENAME_DEFINE_ABOUT_US, ‘false’);
?>
5.在includes/filenames.php文件增加如下代码:
define(‘FILENAME_DEFINE_ABOUT_US’, ‘define_about_us’);
6.在includes\languages\english目录中新建文件about_us.php,并在文件中增加如下代码:
<?php
define(‘NAVBAR_TITLE’, ‘About Us’);
define(‘HEADING_TITLE’, ‘About Us’);
define(‘TEXT_INFORMATION’, ‘About Us information goes here.’);
?>