> Zencart中文手册 > zen-cart 二次开发必备

主样式表
includestemplatesclassicCSSstylesheet.css
整个页面组织
D:WEBzen-cartincludestemplatestemplate_defaultcommontpl_main_page.PHP

 

网 页左右栏width源代码:<td id=”navColumnOne” style=”width: 150px;”>
动态调用 width: <?php echo COLUMN_WIDTH_LEFT; ?>”>,
在后台 -configuration-layout里可以更改Column Width/Column Width – Left Boxes

商 品分类名称Categories更改:BOX_HEADING_CATEGORIES,
“D:WEBzen-cartincludeslanguagesenglish.php”(78,11):   define(’BOX_HEADING_CATEGORIES’, ‘Categories’);

spooer名称更 改:define(’BOX_HEADING_BANNER_BOX’,'Sponsors’)
默认模板,左spooner对 应’BOX_HEADING_BANNER_BOX’ 右上spooer对’BOX_HEADING_BANNER_BOX_ALL’
右下spooer对应BOX_HEADING_BANNER_BOX2

左边栏处理:只保留 includestemplatestemplate_defaultsideboxestpl_categories.php,在里面增加
图片链接

右边栏的处理:
1.后台设置为保留who’s onlie(sideboxes/whos_online.php),
与之对应的 tpl_box_default_right.php,查找<?php echo $title; ?>进行替换

2.添加左边 栏目内容,对tpl_box_default_right.php更改:

中部修改:
=================
includestemplatestemplate_defaulttemplatestpl_index_default.php

去 掉顶部说明:<?php if (SHOW_CUSTOMER_GREETING == 1) { ?>
<h2><?php echo zen_customer_greeting(); ?></h2>
<?php } ?>

去 掉欢迎信息:
<h1 id=”indexDefaultHeading”><?php echo HEADING_TITLE; ?></h1>

去掉顶部导航:
includestemplatestemplate_defaultcommontpl_main_page.php
<div id=”navBreadCrumb”><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>

模 板顶部修改:
================
zen-cartincludestemplatestemplate_defaultcommontpl_header.php
<div id=”navMain”></div>内可增加链接

<?php
/**
* prepares and displays header output
*
*/
if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == ‘true’ and ($_session['customers_authorization'] != 0 or $_SESSION['customer_id'] == ”)) {
$flag_disable_header = true;
}
require($template->get_template_dir(’tpl_header.php’,DIR_WS_TEMPLATE, $current_page_base,’common’). ‘/tpl_header.php’);?>

上段从<div id=”mainWrapper”>抽出,放在它前面做全屏导航版块

顶部搜索按钮修改:
includestemplatestemplate_defaultcommontpl_header.php   :
<div id=”navMainSearch”><?php require(DIR_WS_MODULES . ’sideboxes/search_header.php’); ?></div>

自动生成导航栏:
includestemplatestemplate_defaulttemplatestpl_modules_categories_tabs.php
将 其代码掏空,重新添加导航代码:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<?php
/**
* Module Template – categories_tabs
*
* Template stub used to display categories-tabs output
*
* @package templateSystem
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_modules_categories_tabs.php 3395 2006-04-08 21:13:00Z ajeh $
*/

include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CATEGORIES_TABS));
?>
<?php if (CATEGORIES_TABS_STATUS == ‘1′ && sizeof($links_list) >= 1) { ?>
<div id=”navCatTabsWrapper”>
<div id=”navCatTabs”>
<ul>
<?php for ($i=0, $n=sizeof($links_list); $i<$n; $i++) { ?>
<li><?php echo $links_list[$i];?></li>
<?php } ?>
</ul>
</div>
</div>
<?php } ?>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

清 除多余的log背景:
zen-cartincludestemplatestemplate_defaultcommontpl_header.php
<div id=”tagline”><?php echo HEADER_SALES_TEXT;?></div>
底部 导航修改:
includestemplatestemplate_defaultcommontpl_main_page.php
<div id=”bannerSix”><?php echo zen_display_banner(’static’, $banner); ?></div>