« 免费计数器和公益广告代码 | Main | 正则表达式系统教程(转) »

关于mt升级后,无法生成javascript的问题

Javascript Errors on Individual Entry Archives
Question

I upgraded to 3.2 and updated my Individual Entry Archive template to use the latest default; but I'm getting Javascript errors when viewing those pages and/or there is no comment posting form or sign-in link for TypeKey commenters.
Answer

If you're seeing Javascript errors which say individualArchivesOnLoad is not defined and/or writeTypeKeyGreeting is not defined, then this means Movable Type cannot find the mt-site.js file. This is a new file introduced in version 3.2 which contains all of the Javascript used for commenting, and is generated from the Site Javascript Index Template.

See Creating The Site Javascript Template so you can generate this file for your weblog and eliminate the Javascript errors.

Creating the Site Javascript Template
Question

How do I create the new "Site Javascript" template after upgrading to version 3.2?
Answer

There are two basic ways to create this template.

You can go to System Overview > Weblogs, choose your weblog, and then select Refresh Template(s). This this will revert all relevant templates in the weblog to the defaults, and also create a Site JavaScript template in that weblog for you.

OR

You can take the following steps to create only this template with the correct default code:

1. In your weblog, on the Templates > Indexes tab, select Create New Index Template.
2. Specify Site JavaScript1 as the Template Name, and mt-site.js as the Output File.
3. Make sure that "Rebuild this template automatically when rebuilding index templates" is checked, and then click SAVE.
4. Click Templates in either the left sidebar or the breadcrumbs menu to return to the Templates listing.
5. Select the new Site JavaScript template you just created.
6. Select Refresh Template(s) from the More Actions dropdown menu, and click GO.

This will create a new Site JavaScript template with the default code, as well as a "backup" template which can just be deleted (since it will be empty).

After creating this new template, you'll need to rebuild it to generate the mt-site.js file in your blog path.


RelatedEntries:
文件操作 - 10 28, 2003
OSW:12.CVS设置与应用 - 10 28, 2003
MySQL AB Acquires Alzato - 10 24, 2003
cvs - 10 24, 2003
使用CVS进行版本管理 - 10 23, 2003



Post a comment