Beispiel #1
0
 /**
  * Sets found items array
  * @param $data
  * @param $type
  */
 private function setItems($data, $type)
 {
     foreach ($data as $item) {
         $this->items[] = ['id' => $type != 'article' ? $item->id : $item['article_id'], 'title' => $type != 'article' ? $item->title : $item['article_title'], 'breadcrumbs' => MenuContent::getBreadCrumbs($type != 'article' ? $item->parent_id : $item['menu_item_id'], [], false), 'perex' => StringHelper::truncateWords($type == 'category' ? $item->category->description : ($type == 'content' ? $item->content->perex ? $item->content->perex : $item->content->description : $item['perex']), 30), 'url' => $type != 'article' ? $item->getUrl() : ArticleContent::getUrl($item['menu_item_title'], $item['menu_item_id'], $item['article_title'], $item['article_id']), 'updated_at' => $type != 'article' ? $item->updated_at : $item['article_updated_at']];
     }
 }
Beispiel #2
0
<?php

/* @var $this yii\web\View */
/* @var $content string */
/* @var $menuContent \frontend\models\MenuContent */
use frontend\assets\basic\BasicContentAsset;
use frontend\components\SiblingMenus;
use frontend\models\MenuContent;
use yii\helpers\Url;
use yii\widgets\Breadcrumbs;
BasicContentAsset::register($this);
$menuContent = $this->params['menuContent'];
$breadcrumbs = MenuContent::getBreadCrumbs($menuContent->id);
$this->beginContent($this->theme->getPath('layouts/main.php'));
?>

	<section>
		<div class="container">
			<div class="page-title">
				<h2>
					<?php 
if ($breadcrumbs) {
    echo Breadcrumbs::widget(['homeLink' => ['label' => Yii::t('front', 'home'), 'url' => Yii::$app->homeUrl], 'activeItemTemplate' => "<span>{link}</span>", 'itemTemplate' => "<span>{link}</span>", 'links' => $breadcrumbs, 'tag' => 'div', 'options' => ['class' => 'breadcrumbs']]);
}
?>
					<?php 
echo ucfirst($this->title);
?>
				</h2>
			</div>
		</div>
Beispiel #3
0
<?php

/* @var $this yii\web\View */
/* @var $content string */
/* @var $menuContent \frontend\models\MenuContent */
/* @var $articleContent \frontend\models\ArticleContent */
use frontend\assets\basic\BasicContentAsset;
use frontend\components\CategoryArticlesList;
use frontend\models\MenuContent;
use yii\helpers\Url;
use yii\widgets\Breadcrumbs;
BasicContentAsset::register($this);
$menuContent = $this->params['menuContent'];
$articleContent = $this->params['articleContent'];
$breadcrumbs = MenuContent::getBreadCrumbs($menuContent->id, [], true);
$windowOpen = 'javascript:window.open(this.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;';
$this->beginContent($this->theme->getPath('layouts/main.php'));
?>

	<section>
		<div class="container">
			<div class="page-title">
				<h2>
					<?php 
if ($breadcrumbs) {
    echo Breadcrumbs::widget(['homeLink' => ['label' => Yii::t('front', 'home'), 'url' => Yii::$app->homeUrl], 'activeItemTemplate' => "<span>{link}</span>", 'itemTemplate' => "<span>{link}</span>", 'links' => $breadcrumbs, 'tag' => 'div', 'options' => ['class' => 'breadcrumbs']]);
}
?>
					<?php 
echo $articleContent->title;
?>