建立templateDetails.xml
現在我們繼續處理在管理介面裡用來識別樣板的XML檔案。CSS樣式表和影像、程式碼必須包含在這個XML檔案裡。
使用文字編輯器打開一個空白檔案,複製下面你所看到的內容存在
Template資料夾,檔名命名為
templateDetails.xml (注意要大寫D,其他的小寫)。
<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall type="template" version="1.0">
<name>Template Name</name>
<creationDate>Date of template creation</creationDate>
<author>Author</author>
<copyright>Copyright</copyright>
<authorEmail>Email</authorEmail>
<authorUrl>Web Site</authorUrl>
<version>Version</version>
<description>Brief Description</description>
<files>
<filename>index.php</filename>
<filename>template_thumbnail.png</filename>
</files>
<images>
<filename>Image Files</filename>
</images>
<css>
<filename>css/template_css.css</filename>
</css>
</mosinstall>
樣板縮圖檔
樣板縮圖檔(
template_thumbnail.png)是一個200x150像素的小影像檔,是樣板選擇器這個模組具備來預視的縮圖。
來製作一個縮圖-使用你習慣使用的瀏覽器打開樣板,使用鍵盤上的
PrintScrn鍵。接著需要使用影像編輯器,如PhotoShop或
Gimp(Gimp是開源軟體 (免費)我們打開影像編輯器,找到檔案>新增>貼上,你應該可以看到樣板的影像了,把尺寸縮小到寬200像素,高150像素,然後在樣板的資料夾裡存成
template_thumbnail.png
就這樣,完成了!