user-pic

给MovableType Category 添加 RSS Feed

Vote 0 Votes

上次我在给“Movabletype Individual Entries RSS 的制作”中提到 给Movabletype 也能实现给每个 Category 添加一个 RSS 。现在我们来完成这个任务:

1、进入 MT 的 Templates 菜单,选择 Movabletype 提供的 RSS 模版,如:RSS 2.0 Index。进入编辑模式后,复制下所有内容(template body)。

2.、回到 Templates 菜单,进入“汇整相关模版 (Archive) ”栏目,选择 Create new archive template (如果你用的是中文。 进入增加模式后,你可以给新模板取一个名字,例如“Category RSS”,然后粘贴刚才Copy 的代码。最后按“保存(Save)”按钮。

3.、点击 MT 的 Weblog Config 菜单(中文的“核心设定”)。选择 “Archive Files”,在“Create A New Template/Archive Type Association”处,“Archive Type”选择 “Category(类别)”,在 Template 处选择刚才的“Category RSS”,然后按 “加入(Add)” 按钮。

4、这时,在下面的 Category(类别)处,在原有的“Category Archive”下会多出一个 “Category RSS”, 在右边的文字栏中(即 Archive File Template / 汇整档案模板) 加入以下 code 来指定输出 RSS 的文件名:

%c/index.xml或者<MTArchiveCategory dirify="1">.xml

最后按保存按钮。

5、重建你的 weblog, 此时就会在你的相关文档下面建立你每个 category 的 xml 文档。

6、你可以使用以下代码来输出你的 Category RSS 的地址:

<MTCategories>
<a href="<MTBlogArchiveURL><MTCategoryLabel dirify="1">.xml">
<MTCategoryLabel></a></MTCategories> 

但这样定位对一些二级分类则无效果。建议使用下面标签进行定位:

<MTEntries lastn="1"><MTEntryCategories>
<a href="<$MTCategoryArchiveLink$>index.xml"><$MTCategoryLabel$>
</a></MTEntryCategories></MTEntries>

Add a Reply

Forum Groups

Blogcs 基于MT平台的BSP

MovableType 中文化

1 0

Last Topic: Movable Type 中文化 - 平生一笑 by bb on 2008年10月11日

1 0

Last Topic: Zhu8's Weblog:猪八的网:浮生志 by Zhu8 on 2008年10月16日

MovableType 问题咨询

Be the first to post a topic in this forum

MovableType 使用

16 11

Last Topic: Image::Magick 模块的安装 by bb on 2008年11月 9日

30 35

Last Topic: MT-Twitter:将MT文章同步到Twitter by bb on 2008年3月 9日

22 1

Last Topic: 修改MT的作者归档路径 by bb on 2008年10月25日

MovableType 模板

Be the first to post a topic in this forum

22 17

Last Topic: MovableType评论格式化 replies-to-replies by bb on 2008年10月15日

MovableType 延伸

14 17

Last Topic: 从Wordpress转移到Movabletype by bb on 2007年5月12日

2 2

Last Topic: 最新版MovableType 4.22 已经发布 by bb on 2008年11月19日