8
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【baserCMS:初心者向け】アイキャッチ画像の出力の色々

Last updated at Posted at 2018-10-16

##アイキャッチの出力

シンプルに画像だけを出したい時はコレ

<?php $this->Blog->eyeCatch($post, array('link' => false)); ?>

##アイキャッチに記事へのリンクを貼る
アイキャッチ画像に記事へのaタグリンクをつける時はコレ

<?php $this->Blog->postLink($post, $this->Blog->getEyeCatch($post, array('link' => false))); ?>

'target' => '_blank'なんかも任意でお使いください

##アイキャッチがない時は別画像
アイキャッチ画像が登録されて入ればアイキャッチを表示し、アイキャッチが登録されてなければ任意の画像を表示させたい時はコレ

<?php echo $this->Blog->getEyeCatch($post, array('noimage'=>'dummy.jpg','link' => false)); ?>
8
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?