3108 - Важно - удаление лишних разделов из sitemao.xml

parent 209b8f44
...@@ -21,8 +21,7 @@ class UrlManager extends \yii\web\UrlManager ...@@ -21,8 +21,7 @@ class UrlManager extends \yii\web\UrlManager
foreach ($documents as $document) { foreach ($documents as $document) {
$content = $document->docContents; $content = $document->docContents;
if ($content) { if ($content) {
foreach ($content[0]->langs as $lang) $rules['<document:(' . $content[0]->url . ')>'] = 'documentation/page/view';
$rules['<document:(' . $lang->url . ')>'] = 'documentation/page/view';
} }
} }
......
...@@ -21,8 +21,7 @@ class PageController extends \common\components\BaseController ...@@ -21,8 +21,7 @@ class PageController extends \common\components\BaseController
public function actionView($document) public function actionView($document)
{ {
$modelContent = $this->findDocumentModel($document); $model = $this->findDocumentModel($document);
$model = $modelContent->content;
$documentation = $model->lang->html; $documentation = $model->lang->html;
...@@ -33,7 +32,6 @@ class PageController extends \common\components\BaseController ...@@ -33,7 +32,6 @@ class PageController extends \common\components\BaseController
return $this->render('view', [ return $this->render('view', [
'documentation' => $documentation, 'documentation' => $documentation,
'model' => $model, 'model' => $model,
'modelContent' => $modelContent
]); ]);
} }
...@@ -62,7 +60,7 @@ class PageController extends \common\components\BaseController ...@@ -62,7 +60,7 @@ class PageController extends \common\components\BaseController
*/ */
protected function findDocumentModel($url) protected function findDocumentModel($url)
{ {
$langContent = \common\modules\documentation\models\DocContentLang::findOne(['url' => $url]); $langContent = \common\modules\documentation\models\DocContent::findOne(['url' => $url]);
if ($langContent !== null) { if ($langContent !== null) {
return $langContent; return $langContent;
} else { } else {
......
...@@ -15,7 +15,7 @@ $encodedUrl = yii\helpers\Url::current([], true); ...@@ -15,7 +15,7 @@ $encodedUrl = yii\helpers\Url::current([], true);
$this->registerMetaTag(['property' => 'og:type', 'content' => 'article']); $this->registerMetaTag(['property' => 'og:type', 'content' => 'article']);
$this->registerMetaTag(['property' => 'og:title', 'content' => $modelContent->name]); $this->registerMetaTag(['property' => 'og:title', 'content' => $model->name]);
$this->registerMetaTag(['property' => 'og:image', 'content' => 'https://task-on.com/images/taskon.png']); $this->registerMetaTag(['property' => 'og:image', 'content' => 'https://task-on.com/images/taskon.png']);
$this->registerMetaTag(['property' => 'og:description', 'content' => 'Разработка высоконагруженных сервисов, интернет порталов, корпоративных порталов.']); $this->registerMetaTag(['property' => 'og:description', 'content' => 'Разработка высоконагруженных сервисов, интернет порталов, корпоративных порталов.']);
$this->registerMetaTag(['property' => 'og:url', 'content' => Url::current([], true)]); $this->registerMetaTag(['property' => 'og:url', 'content' => Url::current([], true)]);
...@@ -119,7 +119,7 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр ...@@ -119,7 +119,7 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр
<a href="/">Главная</a> <a href="/">Главная</a>
<span>|</span> <span>|</span>
<a href="/<?= common\models\Settings::getValue('documentation-home-page') ?>">Документаци для разраотчиков</a> <a href="/<?= common\models\Settings::getValue('documentation-home-page') ?>">Документаци для разраотчиков</a>
<span>|</span> <?php echo $modelContent->name ?><br> <br> <span>|</span> <?php echo $model->name ?><br> <br>
</div> </div>
</div> </div>
</div> </div>
...@@ -136,13 +136,13 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр ...@@ -136,13 +136,13 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр
<!-- Post--> <!-- Post-->
<h1><?php echo $modelContent->name ?></h1> <h1><?php echo $model->name ?></h1>
<div class="single-post-meta"> <div class="single-post-meta">
<div class="meta-link"><i class="icon-clock"></i> Обновлено: <?= $model->list->getFormatedCreatedAt() ?></div> <div class="meta-link"><i class="icon-clock"></i> Обновлено: <?= $model->list->getFormatedCreatedAt() ?></div>
</div> </div>
<?php echo str_replace(['<!-- ¿¿¿CAROUSEL_BEGIN¿¿¿ -->', '<!-- ¿¿¿CAROUSEL_END¿¿¿ -->'], ['<div class="owl-carousel owl-carousel-need-replace hidden" data-owl-carousel="{ &quot;nav&quot;: true, &quot;dots&quot;: true, &quot;loop&quot;: true }">', '</div>'], $modelContent->html) ?> <?php echo str_replace(['<!-- ¿¿¿CAROUSEL_BEGIN¿¿¿ -->', '<!-- ¿¿¿CAROUSEL_END¿¿¿ -->'], ['<div class="owl-carousel owl-carousel-need-replace hidden" data-owl-carousel="{ &quot;nav&quot;: true, &quot;dots&quot;: true, &quot;loop&quot;: true }">', '</div>'], $model->html) ?>
<div class="single-post-footer"> <div class="single-post-footer">
<div class="column"> <div class="column">
...@@ -150,7 +150,7 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр ...@@ -150,7 +150,7 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр
<div class="share-links"> <div class="share-links">
<a <a
class="tooltips social-button shape-circle sb-facebook" class="tooltips social-button shape-circle sb-facebook"
href="https://www.facebook.com/sharer/sharer.php?u=<?= $encodedUrl ?>&t=<?php echo $modelContent->name ?>&text=<?php echo $modelContent->name ?>" href="https://www.facebook.com/sharer/sharer.php?u=<?= $encodedUrl ?>&t=<?php echo $model->name ?>&text=<?php echo $model->name ?>"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;"
target="_blank" target="_blank"
data-toggle="tooltip" data-toggle="tooltip"
...@@ -159,7 +159,7 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр ...@@ -159,7 +159,7 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр
><i class="socicon-facebook"></i></a> ><i class="socicon-facebook"></i></a>
<a <a
class="tooltips social-button shape-circle sb-twitter" class="tooltips social-button shape-circle sb-twitter"
href="https://twitter.com/share?url=<?= $encodedUrl ?>&text=<?php echo $modelContent->name ?>" href="https://twitter.com/share?url=<?= $encodedUrl ?>&text=<?php echo $model->name ?>"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;"
target="_blank" target="_blank"
data-toggle="tooltip" data-toggle="tooltip"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment