カスタムフィールドを利用したポッドキャスト
MTでポッドキャストを行う方法としてプラグインを使用する方法があると思うのですが、カスタムフィールドで指定した値は取得できないようなので、RSSに直接記載してポッドキャストの取得を行うことに致しました。
まず、カスタムフィールドで音源アップ用のフィールドを作成致します。
ex.)<$mt:fooPodcast>
MT4.2からRSSのフィードがないので、RSS2.0のテンプレート(index.xmlなど)を追加致します。ポッドキャストに最低限、必要なRSSは以下の通りです。
<?xml version="1.0" encoding="<$MTPublishCharset$>"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title><$mt:BlogName remove_html="1" encode_xml="1"$></title><link><$mt:BlogURL$></link><language><$mt:DefaultLanguage$></language><copyright>[著作権表示]</copyright><image><url>[RSS用画像のURL ex.)/img/foo.jpg]</url><title><$mt:BlogName remove_html="1" encode_xml="1"$></title><link><$mt:BlogURL$></link></image><itunes:subtitle><$mt:BlogDescription encode_xml="1"$></itunes:subtitle><itunes:author><mt:Authors><$mt:AuthorDisplayName$></mt:Authors></itunes:author><itunes:summary><$mt:BlogDescription encode_xml="1"$></itunes:summary><description><$mt:BlogDescription encode_xml="1"$></description><itunes:owner><itunes:name>[著者名]</itunes:name><itunes:email>[著者Email]</itunes:email></itunes:owner><itunes:image href="[RSS用画像のURL ex.)/img/foo.jpg]" /><itunes:category text="comedy"></itunes:category><mt:Entries lastn="15">
<item><title><$mt:EntryTitle remove_html="1" encode_xml="1"$></title><itunes:author>[著者名]</itunes:author><itunes:subtitle>[サブタイトル]</itunes:subtitle><itunes:summary><$mt:EntryBody remove_html="1" encode_xml="1"$></itunes:summary><enclosure url="<mt:FooPodcastAsset><$mt:AssetURL$></mt:FooPodcastAsset>" length="<mt:FooPodcastAsset><$mt:AssetProperty property="file_size" format="0"$></mt:FooPodcastAsset>" type="<mt:FooPodcastAsset><$mt:AssetMimeType$></mt:FooPodcastAsset>" /><description><$mt:EntryBody remove_html="1" encode_xml="1"$></description><link><$mt:EntryPermalink encode_xml="1"$></link><guid><$mt:EntryPermalink encode_xml="1"$></guid><pubDate><$mt:EntryDate format_name="rfc822"$></pubDate><itunes:duration>[データ時間 ex.)7:04 (記載しなくてもitunesでは取得時に表示されるようです)]</itunes:duration><itunes:keywords><$mt:EntryKeywords encode_xml="1"$></itunes:keywords></item></mt:Entries></channel></rss>
あまり見慣れないテンプレートタグである、MTAssetPropertyとMTAssetMimeTypeは今回初めて使いました。
・MTAssetProperty
property モディファイアに表示したいデータを設定し、アイテムの詳細データを表示します。
・MTAssetMimeType
アイテムの MIME Type を表示します。例えば HTML 文書であれば text/html と、jpg イメージであれば image/jpeg となります。
■参考URL
・Movable Type 4.2以降でRSS 2.0のフィードを配信する[The blog of H.Fujimoto]
・Podcastを作成する[アップル]
・asset|テンプレートタグリファレンス[MOVABLETYPE.JP]




