LifeType 外掛 – stickyposts 文章置頂及公告

外掛:stickyposts
功能:文章置頂及公告
適用:LifeType 1.2 系列
來源地:阿杰老師的部落格實驗 室 http://www.tiec.tp.edu.tw/lifetype/category/102/4720

檔 案:官網下載 | stickyposts.zip (開啟頁面後請至左上處點選檔案→下載)

心得:這個外掛很好用,尤其是用在組織性質的部落格,如:班級部落格、處室部落格,可惜不支援1.2以上的版本,尋 尋覓覓多日,終於在 阿杰老師的部落格 挖到寶,自己再做了點小改版,讓它的字更大。

啟用步驟:
(一) 把檔案解壓縮放置 /plugin 下面
(二)修改 main.template,在 <DIV class=blog>的下方, <!– Loop Start –>的上方,中間有個空白處,插入下列語法

{if !$showAll}
{if $stickyposts->isEnabled()}

<DIV class=sidetitle>置頂文章</DIV>
<DIV class=side>

{assign var=stickys value=$stickyposts->getArticles('sticky')}
{foreach from=$stickys item=post}
<DIV class=sidebody><a title="{$post->getText()|truncate:150:"…"|strip_tags|escape}" href="{$url->postPermalink($post)}">{$post->getTopic()}</a></br></DIV>
{/foreach}
</br>

{assign var=stickyCategory value=$stickyposts->getCategory('sticky')}
<div style="text-align: right;">
<a class=aside href="{$url->categoryLink($stickyCategory)}">更多置頂文章…</a>
</div>
</DIV>

{/if}
{/if}

(三) 讓公告出現在左邊或右邊的欄位中,
修改 links.template或footer.template ,找前面一點的地方貼入下面語法

<<!— 公告 —>

{if $stickyposts->isEnabled()}

<DIV class=sidetitle>公 告 </DIV>
<DIV class=side>
{assign var=stickys value=$stickyposts->getArticles('announce')}
{foreach from=$stickys item=post}
<DIV class=sidebody><li><a title="{$post->getText()|truncate:150:"…"|strip_tags|escape}" href="{$url-

>postPermalink($post)}">{$post->getTopic()}</a></li></br></DIV>
{/foreach}
</br>
{assign var=announceCategory value=$stickyposts->getCategory('announce')}
<div style="text-align: right;">
<a href="{$url->categoryLink($announceCategory)}">更多公告...</a>
</div>
</DIV>

{/if}

(四) 安裝完畢

1 Star2 Stars3 Stars4 Stars5 Stars ( 尚未有人評價 )
Loading...

發佈留言

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

*

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料