2005 Aug 23rd
COREBlogでtitle要素を変更する方法が、
- 元祖 サトシのブログ : COREBlog で ページタイトル(title要素) を変更する
- SiteBites : Improvement about more specific title element - ページタイトル(title要素)変更(改)
で紹介されています。僕もこれを真似してtitle要素を変更していたのですが、中にはタイトルだけでなくサブタイトルをつけてるエントリがあるので、これが表示されるようにちょっと追加。
上記2つのエントリ同様、触るのは「blog_header」です。この中の<title>から</title>の間を以下のようにしました。
<title><dtml-var title_or_id>
    <dtml-if "meta_type == 'COREBlog'">
      <dtml-if year> : <dtml-var year>年<dtml-var month>月<dtml-if day><dtml-var day>日</dtml-if></dtml-if>
      <dtml-if cat_id><dtml-with "getCategory(id=cat_id)"> : Category [<dtml-var name>]</dtml-with></dtml-if>
   <dtml-else> : <dtml-var title><dtml-if subtitle> - <dtml-var subtitle> - </dtml-if>
   </dtml-if>
</title>

これでサブタイトルがあるものは、
with subtitle
てな具合になります。
Posted by setomits at 05:10 | Comments: 4
サブタイトルで思い出したのだけど、
RSSのサブタイトル?が「A Weblog Product for Zope」になってるのは、わざと?
Posted by kharakawa at 10:20 on 2005 Aug 23rd
Re: title要素を変更
おーおーおーおー。ありがとう。
RSS 0.91 と RSS 2.0 それぞれの channel 要素の中の description 要素のことね。
これは DTML を書き間違っていました。本来は rss91_xml と rss20_xml それぞれで
<description><dtml-var blog_description></description>

とするべきところを
<description><dtml-var description></description>

としていたのでした。
Posted by setomits at 10:54 on 2005 Aug 23rd
Re: title要素を変更
おー。直ってますな。仕事がはやい。
Posted by kharakawa at 11:44 on 2005 Aug 23rd
Re: title要素を変更
早いっちゃ早いかもだけど、最初にRSS 2.0 を追加したのは4月なので、
4ヶ月近く間違った状態だったかもという話も....。
Posted by setomits at 07:08 on 2005 Aug 24th
Leave a comment
Required fields are marked with *
search
calendar
Mar 2010
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031   
archives
photos on flickr
www.flickr.com
bookmarks on delicious