■ユーザーズフォーラム リニューアルのお知らせ
新規投稿は新ユーザーズフォーラムにお願いします。
このフォーラムは閲覧専用のアーカイブです。

アイキャッチを条件分岐させたい

haluna > アイキャッチを条件分岐させたい @ 2014/2/11 19:08
度々質問してすみません・・・

baserCMSはWPの<?php if (has_post_thumbnail()) : ?>のような機能はできませんか?

アイキャッチの有無で表示を変更したいのですが・・

<div class="row">
    <?php if もしアイキャッチがあったら: ?>
    <div class="col-md-3>
	<?php $this->Blog->eyeCatch($post) ?>
    </div>
    <div class="col-md-8">
	 <?php $this->BcBaser->contentsTitle() ?>
         <?php $this->Blog->postContent($post) ?>
    </div> 
      
    <?php else: アイキャッチが無かったら ?>
    <div class="col-md-12">
	<?php $this->BcBaser->contentsTitle() ?>
        <?php $this->Blog->postContent($post) ?>
    </div>
    <?php endif ?>
</div>


このような形にしたいのですが、アイキャッチの有無の判定が分かりません・・
$this->BcBaser->isHome()みたいに$this->BcBaser->isEyeCatch()にしてみましたがダメでした。。

Helperに追記するような特別な方法が必要でしょうか?

分かる方いらっしゃいましたらよろしくお願いします。。
tecking > Re: アイキャッチを条件分岐させたい @ 2014/2/11 19:53
halunaさん

未検証ですみませんが getEyeCatch() で判定できないでしょうか?

<?php if ( $this->Blog->getEyeCatch($post) ): ?>
	<!-- アイキャッチがあるときの処理 -->
<?php else: ?>
	<!-- アイキャッチがないときの処理 -->
<?php endif; ?>
haluna > Re: アイキャッチを条件分岐させたい @ 2014/2/11 20:05
返信ありがとうございます!

できました!!

get〜は応用できそうなので色々試してみます!

本当にありがとうございました。