show.php 2.03 KB
<?php
    use common\modules\comment\widgets\CommentWidget;
    use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
?>
<?php

$this->title = $news->meta_title;
$this->params['seo']['title'] = !empty($this->title) ?$this->title :$news->title;
$this->registerMetaTag(['name' => 'description', 'content' => $news->meta_description]);
$this->params[ 'breadcrumbs' ][] = ['label'=>'Статьи','url'=>['/articles']];
$this->params[ 'breadcrumbs' ][] = $news->title;
?>


<div class="container">
    
    <div class="content">
	<h1 class="article_title"><?=$news->title?></h1>
        <div class="artbox_comment_description article_comment_description">
            <?php
                if(!empty( $news->averageRating ) && $news->averageRating->value) {
                    ?>
                    <div class="rateit" data-rateit-value="<?php echo $news->averageRating->value; ?>" data-rateit-readonly="true" data-rateit-ispreset="true"></div>
                    <?php
                }
            ?>
            <p><a href="#artbox-comment">
                    <?php
                        $comment_count = count($news->comments);
                        if($comment_count) {
                            echo "Отзывов: " . $comment_count;
                        } else {
                            echo "Оставть отзыв";
                        }
                    ?>
                </a></p>
        </div>
        <?= Html::img(\common\components\artboximage\ArtboxImageHelper::getImageSrc($news->imageUrl, 'product'), ['class'=>'blog-show-img float-left'])?>
            <?=$news->body?>
            <p class='date'><?=$news->date?></p>
    </div>
    
    <div class="comment-wrapper" style="padding-bottom:25px">
        <div class='comments-border'></div>
        <?php
            echo CommentWidget::widget([
                'model' => $news,
                'layout' => "{form} {reply_form} {list}"
            ]);
        ?>
        <div class="both"></div>
    </div>
    <div class="both"></div>
                                        
</div>