四月 01 2007

LIfeType模版9個基本檔案

作者:Eric | 分類:LifeType | |

LIfeType的模版裡有9個最基本的檔案,

  • main.template這個檔案控制網誌的主頁面
  • postandcomments.template:這個檔案控制網誌文章內容與迴響內容的呈現。
  • commentarticle.template:這個檔案主要用來顯示新增(或回覆)迴響時的表單。
  • posttrackbacks.template:用來顯示網誌文章的所有引用資訊。
  • error.template:顯示錯誤訊息用。
  • album.template:顯示資源中心資料夾下的檔案。
  • albums.template:與上述檔案不同之處,這個檔案室用來顯示資源中心裡所有最上層的資料夾。
  • resource.template:用來顯示檔案詳細資料。
  • searchresults.template:顧名思義,就是用來顯示網誌中搜尋結果。

我們來看一下FallingLeaves-randombanner這模版裡的 main.template,

{include file="$blogtemplate/header.template"}
{include file="$blogtemplate/links.template"}
<!-- Loop Start -->
{if $showAll}
{if $showAll == 1 && $category}
<h2>{$locale->tr("posts")}: {$category->getName()}</h2>
{/if}
{foreach from=$posts item=post}
<!-- showing only the topic of the post, in case we have too many! -->
{assign var="postDate" value=$post->getDateObject()}
{$locale->formatDate($postDate,"%Y.%B%d")} <a href="{$url->postPermalink($post)}">{$post->getTopic()}</a><br/>
{/foreach}
{else}
{foreach from=$posts item=post}
{include file="$blogtemplate/post.template"}
{/foreach}
{/if}
{include file="$blogtemplate/footer.template"}

這檔案裡,又包含了 header、links、post、footer 等四個檔案,在網誌前台上的對應位置

歷史上的今天:

No related posts.

留下您的意見