追記文を同一ページに表示させるカスタマイズ。FC2ブログのテンプレート工房さんのカスタマイズ参考に、Seesaaブログ用に一部改変させて頂きました。(かなり前に了解を得たのに記事にするのが遅くなって申し訳ありません)
サンプルページまず「デザイン」→「HTML」から、HTMLの追加をします。HTML名は何でもいいのでお好きな言葉を入れてください。次にHTMLの<head>と</head>に囲まれた部分(</head>のすぐ上がわかりやすいかも)に以下のスクリプトを入れます。
<script type="text/javascript">
<!--
function showMore(varA1, varB1){
var123 = ('varXYZ' + (varA1));
varABC = ('varP' + (varA1));
if( document.getElementById ) {
if( document.getElementById(var123).style.display ) {
if( varB1 != 0 ) {
document.getElementById(var123).style.display = "block";
document.getElementById(varABC).style.display = "none";
} else { document.getElementById(var123).style.display = "none";
document.getElementById(varABC).style.display = "block"; }
} else { location.href = varB1;
return true; }
} else { location.href = varB1;
return true; }
}
//-->
</script>
<!--
function showMore(varA1, varB1){
var123 = ('varXYZ' + (varA1));
varABC = ('varP' + (varA1));
if( document.getElementById ) {
if( document.getElementById(var123).style.display ) {
if( varB1 != 0 ) {
document.getElementById(var123).style.display = "block";
document.getElementById(varABC).style.display = "none";
} else { document.getElementById(var123).style.display = "none";
document.getElementById(varABC).style.display = "block"; }
} else { location.href = varB1;
return true; }
} else { location.href = varB1;
return true; }
}
//-->
</script>
出来たら保存。HTMLの最初のページで、新しく追加したHTMLの適用ボタンを押します。
次に「デザイン」→「コンテンツ」から記事を選び、コンテンツHTML編集ページへ。変更する部分は下記の色づけされた箇所です。少し上に似た記述があるので、間違えないよう注意してください。
<div class="blogbody">
<h3 class="title"><a href="<% article.page_url %>" class="title"><% article.subject %></a></h3>
<% if:page_name eq 'article' -%>
<div class="text"><% if:diet_log %><% include:article_diet_file %><% /if %><% article.entire_body | bodyfilter(article_info,blog) %><% if:list_tag %><div class="tag-word">タグ:<% loop:list_tag %><a href="<% blog.tag_url(tag) %>"><% tag.word %></a> <% /loop %></div><% /if %>
<% else -%>
<div class="text"><% if:diet_log %><% include:article_diet_file %><% /if %>
<% article.first_body | bodyfilter(article_info,blog) %><% if:list_tag %><div class="tag-word">タグ:<% loop:list_tag %><a href="<% blog.tag_url(tag) %>"><% tag.word %></a> <% /loop %></div><% /if %>
<% /if -%>
上記のタグを下記のタグに変更して保存。
<h3 class="title"><a href="<% article.page_url %>" class="title"><% article.subject %></a></h3>
<% if:page_name eq 'article' -%>
<div class="text"><% if:diet_log %><% include:article_diet_file %><% /if %><% article.entire_body | bodyfilter(article_info,blog) %><% if:list_tag %><div class="tag-word">タグ:<% loop:list_tag %><a href="<% blog.tag_url(tag) %>"><% tag.word %></a> <% /loop %></div><% /if %>
<% else -%>
<div class="text"><% if:diet_log %><% include:article_diet_file %><% /if %>
<% article.first_body | bodyfilter(article_info,blog) %><% if:list_tag %><div class="tag-word">タグ:<% loop:list_tag %><a href="<% blog.tag_url(tag) %>"><% tag.word %></a> <% /loop %></div><% /if %>
<% /if -%>
<div class="blogbody">
<h3 class="title"><a href="<% article.page_url %>" class="title"><% article.subject %></a></h3>
<% if:page_name eq 'article' -%>
<div class="text"><% if:diet_log %><% include:article_diet_file %><% /if %><% article.entire_body | bodyfilter(article_info,blog) %><% if:list_tag %><div class="tag-word">タグ:<% loop:list_tag %><a href="<% blog.tag_url(tag) %>"><% tag.word %></a> <% /loop %></div><% /if %>
<% else -%>
<div class="text"><% if:diet_log %><% include:article_diet_file %><% /if %>
<% article.body | bodyfilter(article_info,blog) %>
<% if:article.body_more %>
<div id="varP<% article.id %>"><p class="readmore"><a href="<% article.page_url %>" onclick="showMore(<% article.id %>,'<% article.page_url %>');return false;"><% article.body_continue_text %></a></p></div> <div id="varXYZ<% article.id %>" style="display:none"><% article.body_more | bodyfilter(article_info,blog) %>
<p class="readclose"><a href="#<% article.id %>aa" onclick="showMore(<% article.id %>,0);return true;">続きを閉じる</a></p></div>
<% /if -%>
<% if:list_tag %><div class="tag-word">タグ:<% loop:list_tag %><a href="<% blog.tag_url(tag) %>"><% tag.word %></a> <% /loop %></div><% /if %>
<% /if -%>
次に「デザイン」→「デザイン一覧」から、使用しているスタイルシートに以下の記述を加えて、【スタイルシートを変更する】ボタンを押して保存。これは追記リンクと本文との間隔を空けるためのものです。15pxのところはお好きに変更してくださって構いません。
<h3 class="title"><a href="<% article.page_url %>" class="title"><% article.subject %></a></h3>
<% if:page_name eq 'article' -%>
<div class="text"><% if:diet_log %><% include:article_diet_file %><% /if %><% article.entire_body | bodyfilter(article_info,blog) %><% if:list_tag %><div class="tag-word">タグ:<% loop:list_tag %><a href="<% blog.tag_url(tag) %>"><% tag.word %></a> <% /loop %></div><% /if %>
<% else -%>
<div class="text"><% if:diet_log %><% include:article_diet_file %><% /if %>
<% article.body | bodyfilter(article_info,blog) %>
<% if:article.body_more %>
<div id="varP<% article.id %>"><p class="readmore"><a href="<% article.page_url %>" onclick="showMore(<% article.id %>,'<% article.page_url %>');return false;"><% article.body_continue_text %></a></p></div> <div id="varXYZ<% article.id %>" style="display:none"><% article.body_more | bodyfilter(article_info,blog) %>
<p class="readclose"><a href="#<% article.id %>aa" onclick="showMore(<% article.id %>,0);return true;">続きを閉じる</a></p></div>
<% /if -%>
<% if:list_tag %><div class="tag-word">タグ:<% loop:list_tag %><a href="<% blog.tag_url(tag) %>"><% tag.word %></a> <% /loop %></div><% /if %>
<% /if -%>
p.readmore,p.readclose{
margin:15px 0 0 0;}
以上で完了です。カスタマイズが反映されてなければ、「ブログ設定」の最新の情報に更新を実行してみてください。margin:15px 0 0 0;}