zbp的側(cè)欄模板結(jié)構(gòu)分成了三層:
sidebar 規(guī)定了側(cè)欄的最外框架
module-xxx 規(guī)定了每個模塊內(nèi)容的細(xì)節(jié)展示
module 規(guī)定了每個模塊的外框架
側(cè)欄模板
sidebar.php 默認(rèn)側(cè)欄模板,可自定義 sidebar2.php~sidebar5.php 等為第2至第5側(cè)欄模板,在這個模板文件里可定義側(cè)欄內(nèi)的模塊外框架應(yīng)如何顯示。
模塊模板
module.php 模塊顯示模板,可定義模塊標(biāo)題等格式,模塊具體內(nèi)容格式其下細(xì)節(jié)模板決定。模塊可用標(biāo)簽如下:
| 標(biāo)簽 | 含義 | 備注 |
|---|---|---|
| {$modules.ID} | 內(nèi)部ID | |
| {$modules.Name} | 模塊名稱 | |
| {$modules.FileName} | 文件名 | 文件名應(yīng)是唯一的,如為主題添加模塊請以theme_主題ID_filename命名,同理,如為插件添加模塊請以theme_插件ID_filename命名 |
| {$modules.Content} | 模塊內(nèi)容 | |
| {$modules.HtmlID} | htmlID | |
| {$modules.Type} | 模塊類型 | ul表示列表型,div表示混雜型 |
| {$modules.MaxLi} | ul類型模塊顯示的最大列數(shù) | 默認(rèn)為10。該數(shù)值不會影響存儲,只會限制前端顯示條數(shù) |
| {$modules.Source} | 模塊屬性 | system=系統(tǒng)模塊,theme=主題模塊,plugin=插件模塊 |
| {$modules.IsHideTitle} | 是否隱藏標(biāo)題 | 1表示隱藏,0表示不隱藏,默認(rèn)不隱藏 |
模塊內(nèi)容細(xì)節(jié)模板
系統(tǒng)模塊內(nèi)容展示自1.5版本開始部分支持模板化,通過這個功能可以細(xì)化模塊內(nèi)容如網(wǎng)站統(tǒng)計信息要顯示具體哪一條等。你可以在 保留模板 中查看默認(rèn)模板代碼作為參考。
各模板文件名及可用標(biāo)簽數(shù)據(jù)如下:
導(dǎo)航欄
module-navbar.php
| 標(biāo)簽 | 含義 |
|---|---|
| {$content} | 導(dǎo)航數(shù)據(jù)未改動,直接返回導(dǎo)航模塊內(nèi)容 |
站點信息
module-statistics.php
| 可用數(shù)據(jù) | 數(shù)據(jù)類型 | 可用參數(shù) | 含義 |
|---|---|---|---|
| $allinfo | 網(wǎng)站統(tǒng)計信息二維數(shù)組 | all_artiles | 文章總數(shù) |
| all_pages | 頁面總數(shù) | ||
| all_categorys | 分類總數(shù) | ||
| all_tags | 標(biāo)簽總數(shù) | ||
| all_comments | 評論總數(shù) | ||
| all_views | 瀏覽總數(shù) |
文章歸檔
module-archives.php
| 可用數(shù)據(jù) | 數(shù)據(jù)類型 | 可用參數(shù) | 含義 |
|---|---|---|---|
| $urls | url對象數(shù)組 | Url | 鏈接 |
| Name | 歸檔名份名 | ||
| Count | 文章數(shù)量 |
日歷
module-calendar.php
| 標(biāo)簽 | 含義 | 備注 |
|---|---|---|
| {$prevMonthUrl} | 上個月鏈接 | |
| {$nowMonthUrl} | 當(dāng)前月鏈接 | |
| {$nextMonthUrl} | 下個月鏈接 | |
| {$nowYear} | 當(dāng)前年份 | |
| {$nowMonth} | 當(dāng)前月份 |
| 可用數(shù)據(jù) | 數(shù)據(jù)類型 | 可用參數(shù) | 含義 |
|---|---|---|---|
| $date | 指定日期對象 | PHP手冊中Date章節(jié) | 指日期歸檔頁面的歸檔月份 |
| $arraydate | 當(dāng)月中含有文章的日期數(shù)組列表 | Url | 文章鏈接 |
| Date | 日期 | ||
| Count | 文章數(shù)量 |
網(wǎng)站分類
module-catalog.php
| 可用數(shù)據(jù) | 數(shù)據(jù)類型 | 可用參數(shù) | 含義 |
|---|---|---|---|
| $maxLi | 數(shù)值 | 最大行數(shù) | |
| $style | 數(shù)值 | 0表示普通列表,1表示樹型,2表示UL嵌套型 | |
| $catalogs | 分類對象列表 | 分類標(biāo)簽 |
最新留言
module-comments.php
| 可用數(shù)據(jù) | 數(shù)據(jù)類型 | 可用參數(shù) | 含義 |
|---|---|---|---|
| $comments | 最近評論對象列表 | 評論標(biāo)簽 |
作者列表
module-authors.php
| 可用數(shù)據(jù) | 數(shù)據(jù)類型 | 可用參數(shù) | 含義 |
|---|---|---|---|
| $authors | 用戶對象列表 | 用戶標(biāo)簽 |
最近發(fā)表
module-previous.php
| 可用數(shù)據(jù) | 數(shù)據(jù)類型 | 可用參數(shù) | 含義 |
|---|---|---|---|
| $articles | 最近發(fā)表文章對象列表 | 文章標(biāo)簽_含獨立頁面 |
標(biāo)簽列表
module-tags.php
| 可用數(shù)據(jù) | 數(shù)據(jù)類型 | 可用參數(shù) | 含義 |
|---|---|---|---|
| $tags | tag標(biāo)簽對象列表 | tag標(biāo)簽 |
新聞熱點
疑難解答
圖片精選