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

parent 209b8f44
......@@ -21,8 +21,7 @@ class UrlManager extends \yii\web\UrlManager
foreach ($documents as $document) {
$content = $document->docContents;
if ($content) {
foreach ($content[0]->langs as $lang)
$rules['<document:(' . $lang->url . ')>'] = 'documentation/page/view';
$rules['<document:(' . $content[0]->url . ')>'] = 'documentation/page/view';
}
}
......
......@@ -21,8 +21,7 @@ class PageController extends \common\components\BaseController
public function actionView($document)
{
$modelContent = $this->findDocumentModel($document);
$model = $modelContent->content;
$model = $this->findDocumentModel($document);
$documentation = $model->lang->html;
......@@ -31,9 +30,8 @@ class PageController extends \common\components\BaseController
$this->meta_keywords = $model->metaTag->keywords;
return $this->render('view', [
'documentation' => $documentation,
'model' => $model,
'modelContent' => $modelContent
'documentation' => $documentation,
'model' => $model,
]);
}
......@@ -62,7 +60,7 @@ class PageController extends \common\components\BaseController
*/
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) {
return $langContent;
} else {
......
......@@ -15,7 +15,7 @@ $encodedUrl = yii\helpers\Url::current([], true);
$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:description', 'content' => 'Разработка высоконагруженных сервисов, интернет порталов, корпоративных порталов.']);
$this->registerMetaTag(['property' => 'og:url', 'content' => Url::current([], true)]);
......@@ -119,7 +119,7 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр
<a href="/">Главная</a>
<span>|</span>
<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>
......@@ -136,13 +136,13 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр
<!-- Post-->
<h1><?php echo $modelContent->name ?></h1>
<h1><?php echo $model->name ?></h1>
<div class="single-post-meta">
<div class="meta-link"><i class="icon-clock"></i> Обновлено: <?= $model->list->getFormatedCreatedAt() ?></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="column">
......@@ -150,7 +150,7 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр
<div class="share-links">
<a
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;"
target="_blank"
data-toggle="tooltip"
......@@ -159,7 +159,7 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр
><i class="socicon-facebook"></i></a>
<a
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;"
target="_blank"
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