Zencart模板結構和設計詳解

2021-08-25 06:32:06 字數 2016 閱讀 2175

zen cart的設計很簡單,和其他html頁面是一樣的。只是整個頁面分成了幾個部分,並加入了php**。

通常分為頁首 (header),頁尾(footer),邊框(sideboxes)。頁面通過css樣式表來控制,樣式表控制了包括**單元的背景圖案、字型顏色和樣 式等等,所以假如你需要修改邊框標題欄的字型,那麼就去檢視樣式表檔案。

zen cart在頁面新增影象有兩種方式。可以使用影象目錄的相對路徑,或者在模板中用php變數定義影象。如果你使用https伺服器,並且採用相對影象路 徑,那麼https的影象目錄下也要有同樣的影象,否則https伺服器很可能會給出警告提示。

zen cart可以設定成任意的html/flash的介面,只是比通常的html頁面的設計費時。你可以從修改預設的模板開始,先修改css檔案和三欄格式的 介面。開始先採用不同的顏色,很快就可以設計出完全不同的風格。

zen cart各部分頁面相對應模板檔案列表:

檔案路徑 注釋

index.php 主檔案

includes/templates/[custom template folder]/common/html_header.php 頁面的head部分

includes/templates/[custom template folder]/common/tpl_main_page.php 頁面的body部分

includes/templates/[custom template folder]/common/tpl_header.php 所有頁面的頁首

(column left)

includes/templates/[custom template folder]/common/main_template_vars.php 決定頁面的內容部分,預設為 『tmp_index_default.php』

首頁 – 預設

includes/templates/[custom template folder]/templates/tmp_index_default.php 首頁模板檔案

首頁 – 顯示分類

includes/templates/[custom template folder]/templates/tpl_index_categories.php 首頁上顯示分類時的模板檔案

includes/modules/[custom template folder]/pages/index/category_row.php 選擇要顯示的分類

includes/templates/[custom template folder]/templates/tpl_index_category_row.php 顯示分類

首頁 – 顯示指定分類

includes/templates/[custom template folder]/templates/tpl_index_product_list.php 首頁上顯示指定的分類時採用的模板檔案

includes/modules/[custom template folder]/product_listing.php 將商品資料新增到陣列

includes/templates/[custom template folder]/templates/tpl_modules_product_listing.php 顯示商品數量和商品導航選單

includes/templates/[custom template folder]/common/tpl_list_box_content.php 顯示商品陣列

商品資訊頁面

includes/templates/[custom template folder]/templates/tpl_product_info_display.php 顯示單件商品資訊

購物車 頁面

includes/templates/[custom template folder]/templates/tpl_shopping_cart_default.php 購物車頁面

(column right)

includes/templates/[custom template folder]/common/tpl_footer.php 所有頁面的頁尾

zencart 模板設計

zen cart的模板設計比較複雜,需要一定的時間來熟悉。一旦你了解了它的結構,就會慢慢習慣了。首先要閱讀常見問答部分的 如何新增 製作新模板。zen cart的設計沒有什麼特別,與以前設計html頁面是一樣的。只是整個頁面分成了好幾個部分,並加入了php 通常,頁面分為頁首 header 頁尾 f...

Django 模板結構優化

一 引入模板 可以使用include標籤來引入其他模板。指定形式 模板名可以使用變數指定,或使用硬編碼的字串。模板路徑 對於引入的模板,使用當前模板的上下文對其進行渲染。如 當前模板的上下文為person john msg hello greet.html內容如下 最終在原模版中渲染的效果 hell...

ECSHOP 模板結構說明

原文 名稱型別 備註 作用或意義 檔案 目錄 名可否更改 images 目錄存放模板目錄 不可更改 library 目錄存放模板庫檔案目錄 不可更改 screenshot.png 用於 後台管理 模板管理 模板選擇 顯示模板縮圖。不可更改 style.css css樣式表 不可更改 brand.dw...