サポート
ユーティリティ画像表示
華子 (2015/12/24 07:59)
設置URL : http://xxx.co.jp
設置URLは予定アドレスです。
ユーティリティに表示される新着画像をサムネイルで表示する方法を
教えてください。お願いします。
ccc (2015/12/25 00:49)
URL : http://cccabinet.jpn.org/
ユーティリティに表示される新着画像をサムネイルで表示する方法を
教えてください。
ユーティリティに表示される新着画像の表示の優先順位は
1.エントリーイメージ画像
2.エントリーファイルのサムネイル画像
3.エントリーファイル画像
4.エントリー本文に挿入されたメディア画像の一番最初のもの
5.それ以外(画像でないエントリーファイルなど)
となります。
つまりエントリーイメージ画像を登録していなければサムネイル画像が表示されるようになっています。
なので、utility.htmlの112行目の
<li><a href="{$freo.core.http_file}/view/{if $plugin_entry_gallery.code}{$plugin_entry_gallery.code}{else}{$plugin_entry_gallery.id}{/if}">
<!--{if $plugin_entry_gallery.image}--><img src="{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_images/{$plugin_entry_gallery.id}/{$plugin_entry_gallery.image}" alt="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" title="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" />
<!--{elseif $plugin_entry_gallery_thumbnails[$plugin_entry_gallery.id]}--><img src="{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_thumbnails/{$plugin_entry_gallery.id}/{$plugin_entry_gallery.file}" alt="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" title="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" />
<!--{elseif $plugin_entry_gallery.file}-->(~略~)<!--{/if}--></a></li>の部分を
<li><a href="{$freo.core.http_file}/view/{if $plugin_entry_gallery.code}{$plugin_entry_gallery.code}{else}{$plugin_entry_gallery.id}{/if}">
<!--{if $plugin_entry_gallery_thumbnails[$plugin_entry_gallery.id]}--><img src="{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_thumbnails/{$plugin_entry_gallery.id}/{$plugin_entry_gallery.file}" alt="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" title="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" />
<!--{elseif $plugin_entry_gallery.image}--><img src="{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_images/{$plugin_entry_gallery.id}/{$plugin_entry_gallery.image}" alt="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" title="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" />
<!--{elseif $plugin_entry_gallery.file}-->(~略~)</a></li>にすれば上記の1と2の優先順位が入れ替わるので、イメージを登録していてもユーティリティの新着画像ではサムネイル画像が表示されるようになると思います。
華子 (2015/12/30 13:56)
URL : http://xxx.co.jp
ご回答ありがとうございます。
私の言葉足らずでご迷惑をかけて申し訳ないのですが
他サイトのスキンを使っていて、うまく対応することが出来ませんでした。
設置したURLを記入しましたので、改めて回答いただけないでしょうか?
ccc (2016/01/02 16:51)
URL : http://cccabinet.jpn.org/
遅くなってすみません。
まず、utility.htmlへの追記部分を以下のようにします。
<div class="utility utilityImage">
<div class="utilityHeader"><h3>gallery</h3></div>
<div class="utilityContent">
<ul><!--{foreach from=$plugin_entry_galleries|smarty:nodefaults item='plugin_entry_gallery'}--><li><a href="{$freo.core.http_file}/view/{if $plugin_entry_gallery.code}{$plugin_entry_gallery.code}{else}{$plugin_entry_gallery.id}{/if}"><!--{if $plugin_entry_gallery_thumbnails[$plugin_entry_gallery.id]}--><img src="{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_thumbnails/{$plugin_entry_gallery.id}/{$plugin_entry_gallery.file}" alt="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" title="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" /><!--{elseif $plugin_entry_gallery.image}--><img src="{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_images/{$plugin_entry_gallery.id}/{$plugin_entry_gallery.image}" alt="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" title="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" /><!--{elseif $plugin_entry_gallery.file}--><img src="{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_files/{$plugin_entry_gallery.id}/{$plugin_entry_gallery.file}" alt="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" title="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" /><!--{elseif $plugin_entry_gallery_medias[$plugin_entry_gallery.id].file}--><img src="{$plugin_entry_gallery_medias[$plugin_entry_gallery.id].file}" alt="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" title="{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}" /><!--{else}-->{$plugin_entry_gallery.memo|default:$plugin_entry_gallery.title}<!--{/if}--></a></li><!--{/foreach}--></ul>
</div>
</div>(続く)
ccc (2016/01/02 16:54)
URL : http://cccabinet.jpn.org/
次に、K.cssの/* ギャラリー */の部分に以下を追加して下さい。
.utilityImage ul li img {
max-width: 180px;
max-height: 130px;
margin-bottom: 5px;
}表示される画像の大きさがうまくいかない場合は上記の数値を調整して下さい。
華子 (2016/01/04 16:43)
おかげさまで思うようなレイアウトが出来ました。
ありがとうございました。
URL削除させて頂きます。
返信
- この記事に返信します。
- 返信の際は、設置URL以外の項目は入力必須です。