public function run() { if ($this->id !== null && ($item = Items::findOne($this->id)) !== null) { $teaser = \worstinme\zoo\helpers\TemplateHelper::render($item, 'teaser'); return "<div class='item item-teaser'>" . $teaser . "</div>"; } if ($this->ids !== null) { $ids = explode(",", $this->ids); $items = Items::find()->where(['id' => $ids])->all(); $html = null; if (count($items)) { $html .= '<div class="uk-grid uk-grid-width-medium-1-2 uk-grid-large uk-grid-match" data-uk-grid-margin>'; foreach ($items as $item) { $teaser = \worstinme\zoo\helpers\TemplateHelper::render($item, 'teaser'); $html .= "<div><div class='item item-teaser'>" . $teaser . "</div></div>"; } $html .= '</div>'; } return $html; } return null; }
<?php use yii\helpers\Html; $rows = $model->getTemplateRows('teaser'); $class = !empty($row['params']) && !empty($row['params']['column']) ? 'uk-grid uk-grid-width-medium-1-' . $row['params']['column'] : ''; ?> <div class="item item-teaser <?php echo $class; ?> "> <?php echo \worstinme\zoo\helpers\TemplateHelper::render($model, 'teaser'); ?> </div>
<?php use yii\helpers\Html; ?> <ul> <?php foreach ($items as $key => $item) { ?> <li> <?php echo \worstinme\zoo\helpers\TemplateHelper::render($item, 'list-item'); ?> </li> <?php } ?> </ul>
<?php use yii\helpers\Html; $this->title = $model->metaTitle; $this->registerMetaTag(['name' => 'description', 'content' => $model->metaDescription]); $this->registerMetaTag(['name' => 'keywords', 'content' => $model->metaDescription]); $this->params['breadcrumbs'] = array_merge(isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], $model->breadcrumbs); $class = !empty($row['params']) && !empty($row['params']['column']) ? 'uk-grid uk-grid-width-medium-1-' . $row['params']['column'] : ''; ?> <article class="<?php echo $app->name; ?> <?php echo $app->name; ?> -item <?php echo $class; ?> "> <?php echo \worstinme\zoo\helpers\TemplateHelper::render($model, 'full'); ?> </article>