Esempio n. 1
0
 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;
 }
Esempio n. 2
0
<?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>
Esempio n. 3
0
<select name="type">
	<?php 
foreach (\worstinme\zoo\helpers\TemplateHelper::types() as $value) {
    ?>
		<?php 
    if (!empty($row['type']) && $row['type'] == $value) {
        ?>
			<option selected value="<?php 
        echo $value;
        ?>
"><?php 
        echo $value;
        ?>
</option>

		<?php 
    } else {
        ?>
			<option value="<?php 
        echo $value;
        ?>
"><?php 
        echo $value;
        ?>
</option>
		<?php 
    }
    ?>
	<?php 
}
Esempio n. 4
0
<?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>
Esempio n. 5
0
<?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>