Category Archives: MovableType

给mt增加了随机文章MTRandomEntries插件

一直使用的是相关文章插件。但似乎相关文章,显示的总是当前页面生成时,最新发表的3篇文章。。。
 
所以增加这个随机文章插件,目的是增强网站内部的联系。
安装很简单,只需要下载之后,解压到MT的plugins目录即可。然后在模版添加下面的代码:
<MTRandomEntries category="Gaming" lastn="5">
<a href="<$MTEntryLink$>"><$MTEntryTitle$></a>:<br />
<$MTEntryExcerpt$><br />
</MTRandomEntries>
注意,其中的Gaming是你需要显示的分类名称。

Continue reading

Googlify your Movable Type Blog

With the recent release of the new version of Google’s toolbar for Internet Explorer on Windows, it’s now possible to make your own custom buttons for the popular browser extension. Once installed, the button gives you easy access to your most recent entries and provides you with a simple way to search your site for a word or phrase you highlight on any web page.
 
In addition to just being a cool feature for your own personal use, by providing it to your visitors, it’s also a great vehicle for promoting and increasing traffic to your Movable Type-powered blog.
 
Creating a Google Toolbar button for your site
So how do you do it? Easy. You can just make use of the template that Niall Kennedy created, which uses the power of Movable Type’s publishing engine to automatically generate the code for the button.
 
First, create a new index template. You might want to name it "Google Toolbar Button" and then set the Output File to toolbar_button.xml. Then, copy the following text and paste it in as the body of the template.
 
<?xml version="1.0" encoding="utf-8"?>
<custombuttons xmlns="http://toolbar.google.com/custombuttons/">
  <button>
    <title><$MTBlogName remove_html="1" encode_xml="1"$></title>
    <description><$MTBlogDescription remove_html="1" encode_xml="1"$></description>
    <site><$MTBlogURL$></site>
    <search><$MTCGIPath$><$MTSearchScript$>?search={query}&IncludeBlogs=<$MTBlogID$></search>
    <send><$MTCGIPath$><$MTSearchScript$>?search={selection}&IncludeBlogs=<$MTBlogID$></send>
    <feed refresh-interval="3600"><$MTBlogURL$>atom.xml</feed>
     <icon mode="base64" type="image/x-icon">AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAD///8A//f3APf39wD39+8A9+/vAO/v5wDv5+cA5+feAN7e1gDe3s4A3tb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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHRoNGh0dHR0dHR0dIR0dHR0EECIdHSIdHR0dHR0d
HSIVABciHR0YHR0dHR0dHR0iDgAFHSIdBx0dHR0dHR0dHQUAAAcNBQkdHR0dHR0dIhMAAAAAAAUa
HR0dHSIdHRUAAAAFCRAcHR0dHR0UDQQAAAAQGiIiHR0dHRoIDQ4IAAAQIh0dIR0dHR0JDSIiGgUE
HR0dHR0dHR0dBBoiHSIQDSIdHR0dHR0dHQUXIh0dDRAhHR0dHR0dHR0VABodFQAaIh0dHR0dHR0d
HRUHAAkaHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</icon>
  </button>
</custombuttons>

Save the template, rebuild it (if necessary), and your new button code should be all set. By default, your output should look something like this. Then, your last step is to make a simple link to your new file. That should look like:

 <a href="http://toolbar.google.com/buttons/add?url=[your blog URL]toolbar_button.xml">Add to Google Toolbar</a>

The results will give you a link that says Add to Google Toolbar. So what are you waiting for? Click the button! Then you’ll have a new toolbar button updating you on the latest Movable Type news, along with a new search function that lets you have direct access to the Movable Type knowledge base and help documentation. Then be sure to post your own button link on your blog.

Still not appeased the Googlebot enough? Be sure to check out Niall’s Sitemap instructions, which let you simply and easily make a Google Sitemap XML file, which lets you instruct Google’s spiders on how to crawl your site, while letting you as the site owner have access to more statistics and information about your site.

If you want to make your site as reader-friendly (and Google-friendly) as possible, it’s easy to start with Movable Type today and you’ll be button-making, sitemapping and blogging in no time.

 

 

关于在mt中显示最新评论的完整代码

matt给了我下面这段代码,用来解决上篇文章提到的问题
 
<h2>最近收到的评注</h2>
<ul>
<MTComments lastn="12"  sort_order="descend">
<MTCommentEntry>
<li><a href="<$MTEntryPermalink$>#comment-<$MTCommentID$>">
Re:
<$MTEntryTitle$>
   </a>
   </MTCommentEntry>
  , by
  <$MTCommentAuthor$>
  (
   <$MTCommentDate format="%b %d"$>
)
</li>
</MTComments>
</ul>
 <p class="entry-footer">
 </p>
 
 
针对自己的css,修改了下,我使用就是下面这段
 
<div>
<h2 class="module-header">Recent Comments</h2>
<ul class="module-list">
<MTComments lastn="24" sort_order="descend">
<MTCommentEntry>
<li class="module-list-item">
<a href="<$MTEntryPermalink$>#more">
<$MTCommentBody$></a></li>
</MTCommentEntry>
</MTComments>
</ul>
</div>

关于在mt中显示最新评论的

如何在mt中显示最新评论,官方给的代码是
 
<MTComments lastn="6" sort_order="descend">
<p><$MTCommentAuthor$> said:<br />
<$MTCommentBody$></p>
</MTComments>
 
但是,这样的话,是没有链接的,效果不好。
我修改之后的是
 
<div>
<h2 class="module-header">Recent Comments</h2>
<MTEntries lastn="***">
<MTComments lastn="10" sort_order="descend">
<div id="c<$MTCommentID$>">
<ul class="module-list">
<li class="module-list-item">
<a href="<$MTEntryPermalink$>#more">
<$MTCommentBody$></a>
</div>
</MTComments></MTEntries>
</MTEntryIfCommentsActive>
</li>
</ul>
</div>
 
似乎mtcomments 中参数lastn现在不起作用。
这里的问题就是,<mtcomments>,必须在<MTEntries></MTEntries> 中,而在这一段代码中,如果不给<MTEntries>制订lastn的数目,默认就为首页显示的文章数目。从而导致显示的评论是首页上出现的文章的评论
我的这段代码,只能够实现显示指定数目文章的所有评论,而不能显示指定数目的评论。
继续研究

Who is Melody Nelson?

Question
Who is Melody Nelson, and why is her name used as Movable Type’s default author?
 
Answer
The name comes from Serge Gainsbourg, a French singer-songwriter whose most influential work was a concept album titled Histoire de Melody Nelson (and based on the infamous novel Lolita).
 
The entire album is about the protagonist’s brief (and disturbing) relationship with a teenage English girl named Melody. He meets her when she’s riding her bicycle, and bumps into her with his Rolls. That begins a passionate but short love affair, which ends when Melody’s plane crashes and she dies.
 
Ben and Mena’s mutual love for this 1971 masterpiece was the inspiration for the default username and password for Movable Type.
 
(Bonus trivia: when they were first developing the system, they called it "Serge". Imagine the template tags: <SergeEntries>, <SergeComments>! Then Mena came up with "Movable Type", which we all think is a much better name.)