Web Diary Professional 改造記録
テンプレート側で記述するから添付画像名だけを出力したい・画像のALTを変更したいなどというとき。
/lib/webliberty/App/Diary.pmのline976-
if ($_) { if ($self->{agent} eq 'mobile' and $width > 0 and $height > 0) { $file = "<a href=\"$file_path$_\">ファイル $_</a><br />"; } elsif ($flag and $width > 0 and $height > 0) { $file = "<a href=\"$info_path?mode=image&upfile=$_\"$target><img src=\"$file_path$_\" alt=\"ファイル $_\" width=\"$width\" height=\"$height\" /></a>"; } elsif ($width > 0 and $height > 0) { $file = "<img src=\"$file_path$_\" alt=\"ファイル $_\" width=\"$width\" height=\"$height\" />"; } else { $file = "<a href=\"$info_upfile_path$_\"$target>ファイル $_</a><br />"; } }
を
if ($_) { if ($self->{agent} eq 'mobile' and $width > 0 and $height > 0) { $file = "<a href=\"$file_path$_\">ファイル $_</a><br />"; } elsif ($flag and $width > 0 and $height > 0) { $file = "<a href=\"$info_path?mode=image&upfile=$_\"$target><img src=\"$file_path$_\" alt=\"$subj\" width=\"$width\" height=\"$height\" /></a>"; } elsif ($width > 0 and $height > 0) { $file = "<img src=\"$file_path$_\" alt=\"$subj\" width=\"$width\" height=\"$height\" align=\"right\" />"; } else { $file = "<a href=\"$info_upfile_path$_\"$target>ファイル $_</a><br />"; } }
みたいにする。
これはALTを記事タイトルにしてる。