blog-medium-image-right-sidebar-first.php 1.83 KB
<?php

use yii\helpers\Html;
use frontend\components\ImageResizer;

/**
 *
 * @author FilamentV <vortex.filament@gmail.com>
 * @copyright (c), Thread
 *
 * @var $article \frontend\modules\news\models\Article
 */

$image = $article->getImageLink();
$image = ImageResizer::getThumb($article->getImagePath(), 730, 350);
$link = $article->getUrl();
if ($image === null) {
    $image = '/images/blog-1.jpg';
}
?>
<article class="col-sm-12 col-md-12 col-xs-12" style="overflow: hidden; padding-bottom: 10px;">
    <div class="row">
        <div class="col-md-12">
            <div class="overlay-container">
                <?= Html::img($image, [
                    'alt' => $article['lang']['title'],
                    'style' => 'max-width: 100%; margin-bottom: 8px;'
                ]) ?>
            </div>
        </div>
        <div class="col-md-12">
            <header>
                <div class="post-info" style="margin-bottom: 8px;">
                    <span class="post-date">
                        <i class="icon-calendar"></i>
                        <span class="day"><?= date('d', $article['published_time']) ?></span>
                        <span class="month"><?= date('m.Y', $article['published_time']) ?></span>
                    </span>
                </div>
                <div class="post-title">
                    <?= Html::a(Html::encode($article['lang']['title']), $link) ?>
                </div>
            </header>
            <div class="blogpost-content">
                <p><?= $article['lang']['description'] ?></p>
            </div>
        </div>
    </div>
    <footer class="clearfix">
        <div class="link pull-left">
            <?= Html::a(Yii::t('news', 'More'), $article->getUrl(), [
                'class' => 'btn-new',
            ]) ?>
        </div>
    </footer>
    <div class="clearfix"></div>
</article>