九月 01, 2006

[外掛] 置頂文章 (stickyposts)

如果想讓某些文章一直出現在部落格文章的最上方。可以使用外掛 「置頂文章 - stickyposts」。

加在主文章之上的 置頂文章(如下圖)

文章置頂

加在側選單上的公告文章(如下圖)

文章置頂

系統管理者可以到 LifeType 的官方網站下載

http://sourceforge.net/project/showfiles.php?group_id=83964&package_id=100434



臺北市教師研習中心部落格已經加入了置頂文章的功能!

請由管理面板 > 個人網誌設定 去啟動「置頂及公告文章設定」這項功能

文章置頂

接著可以新增或指定兩個文章分類做為置頂文章分類!

文章置頂


接著一般使用者就要自行去修改模版啦! (請注意或許阿杰老師已經加到模版中啦!)

使用 FireFox 去得知要插入的位置:

文章置頂

使用模版編輯器修改 main.template

<DIV class=blog>

<!--JAY 置頂文章-->
{if !$showAll}
{if $stickyposts->isEnabled()}
<DIV class=sidetitle>置頂文章</DIV>
<DIV class=side>

{assign var=stickys value=$stickyposts->getArticles('sticky')}

{foreach from=$stickys item=post}
<a class=aside href="{$url->postPermalink($post)}">{$post->getTopic()}</a></br>
{/foreach}

{assign var=stickyCategory value=$stickyposts->getCategory('sticky')}
<DIV class=posted>
<a href="{$url->categoryLink($stickyCategory)}">更多置頂文章...</a>
</DIV>

</DIV>
{/if}
{/if}
<!-- JAY END -->

<!-- Loop Start -->

如此就會出現

文章置頂

PS : 利用 {if !$showAll} {/if}去設定只出現在部落格首頁中!


修改 links.template

顯示在選單中

<!-- jay 公告 -->
<DIV class=sidetitle>公告</DIV>
<DIV class=side>

{if $stickyposts->isEnabled()}
{assign var=stickys value=$stickyposts->getArticles('announce')}
{foreach from=$stickys item=post}
<a class=aside href="{$url->postPermalink($post)}">{$post->getTopic()}</a></br>
{/foreach}
{assign var=announceCategory value=$stickyposts->getCategory('announce')}
<DIV class=posted><a href="{$url->categoryLink($announceCategory)}">更多公告...</a></DIV>
{/if}

</DIV>

<!-- jay end -->

會呈現如下

文章置頂


發佈者: 陳怡杰 老師 at 13:43│  點閱次數 (819)│ 修改文章管理迴響迴響 (0)精華置頂
回應文章
(必要)
authimage