Template and LifeType Object |
出自LifeType 中文文件計畫
第6行: | 第6行: | ||
main.template | main.template | ||
+ | |||
$posts: 首頁所使用文章的陣列. | $posts: 首頁所使用文章的陣列. | ||
postandcomments.template | postandcomments.template | ||
+ | |||
$post: 當前顯示的文章. * $comments: 當前文章的評論的陣列(comments) | $post: 當前顯示的文章. * $comments: 當前文章的評論的陣列(comments) | ||
第16行: | 第18行: | ||
commentarticle.template | commentarticle.template | ||
+ | |||
$post: 正在評論(comment on)的文章. | $post: 正在評論(comment on)的文章. | ||
posttrackbacks.template | posttrackbacks.template | ||
+ | |||
$post: 正在獲取trackback的文章. | $post: 正在獲取trackback的文章. | ||
第24行: | 第28行: | ||
error.template | error.template | ||
+ | |||
$message: 一條錯誤訊息的字符串(String). | $message: 一條錯誤訊息的字符串(String). | ||
searchresults.template | searchresults.template | ||
+ | |||
tbd | tbd | ||
albums.template | albums.template | ||
+ | |||
$albums | $albums | ||
第35行: | 第42行: | ||
resource.template | resource.template | ||
+ | |||
$resource | $resource | ||
第44行: | 第52行: | ||
$blog: An object containing information about the current blog, such as the name and description. | $blog: An object containing information about the current blog, such as the name and description. | ||
$locale: Provides methods to translate strings based on the current locale. It also formats dates and numbers. | $locale: Provides methods to translate strings based on the current locale. It also formats dates and numbers. | ||
+ | |||
$calendar: A string containing HTML code representing the calendar. It can be customized via CSS stylesheets. | $calendar: A string containing HTML code representing the calendar. It can be customized via CSS stylesheets. | ||
+ | |||
$archives: An array representing links to the archives. Each item represents a valid url pointing to the archives for that month. Archives are sorted chronologically, newest first, by months. | $archives: An array representing links to the archives. Each item represents a valid url pointing to the archives for that month. Archives are sorted chronologically, newest first, by months. | ||
+ | |||
$recentposts: An array of post objects that contains the most recent posts made in the blog. | $recentposts: An array of post objects that contains the most recent posts made in the blog. | ||
+ | |||
$articlecategories: An array of category objects with all the different categories availables. | $articlecategories: An array of category objects with all the different categories availables. | ||
+ | |||
$mylinks: Cotains a list with all the links that have been set up for this blog. | $mylinks: Cotains a list with all the links that have been set up for this blog. | ||
+ | |||
$utils: Provides commodity methods to generate urls and other information. | $utils: Provides commodity methods to generate urls and other information. | ||
+ | |||
$rss: An RSS aggregator. See PLog 1.0/How to use the RSS aggregator for more information on this object. | $rss: An RSS aggregator. See PLog 1.0/How to use the RSS aggregator for more information on this object. | ||
+ | |||
Finally, it is also advisable to have a look at one of the template sets that comes with the main distribution of pLog. | Finally, it is also advisable to have a look at one of the template sets that comes with the main distribution of pLog. |
在2006年4月4日 (二) 12:05所做的修訂版本
How to create new template sets
當查看模版文件時, 你會發現類似: {$post->getTopic()}, {$calendar} 或是 {$utils->postPermalink($post)}的東西. 這些全都是輸出給模版使用的特殊物件. 以下是基本模版能使用的物件以及所有模版都能使用的物件的簡介:
以下對基本模版有效的模版物件:
main.template
$posts: 首頁所使用文章的陣列.
postandcomments.template
$post: 當前顯示的文章. * $comments: 當前文章的評論的陣列(comments)
$prevpost: 上一篇文章的物件, 如果存在(原文: A post object representing the next post in the database, if any).
$nextpost: 下一篇文章的物件, 如果存在(原文: Another post object representing now the previous post in the database, if any).
commentarticle.template
$post: 正在評論(comment on)的文章.
posttrackbacks.template
$post: 正在獲取trackback的文章.
$trackbacks: 當前文章的trackbacks的物件陣列.
error.template
$message: 一條錯誤訊息的字符串(String).
searchresults.template
tbd
albums.template
$albums
$album
resource.template
$resource
$albums
以下是對所有模版有效的模版物件:
$blog: An object containing information about the current blog, such as the name and description. $locale: Provides methods to translate strings based on the current locale. It also formats dates and numbers.
$calendar: A string containing HTML code representing the calendar. It can be customized via CSS stylesheets.
$archives: An array representing links to the archives. Each item represents a valid url pointing to the archives for that month. Archives are sorted chronologically, newest first, by months.
$recentposts: An array of post objects that contains the most recent posts made in the blog.
$articlecategories: An array of category objects with all the different categories availables.
$mylinks: Cotains a list with all the links that have been set up for this blog.
$utils: Provides commodity methods to generate urls and other information.
$rss: An RSS aggregator. See PLog 1.0/How to use the RSS aggregator for more information on this object.
Finally, it is also advisable to have a look at one of the template sets that comes with the main distribution of pLog.