MrKarandash

MrKarandash

Был в сети 01 апреля 2022, 14:21
Заказы не принимаю
[[!pdoMenu? 
    			&context=`[[*context_key]]`
    			&select=`id,pagetitle`
    			&parents=`0, -229`
    			&level=`2`
    			&templates=`16,13`
    			&tplOuter=`@INLINE [[+wrapper]]`
    			&tpl=`@INLINE <li id="menu[[+id]]"><a href="[[+link]]">[[+pagetitle]]</a><span></span>[[+wrapper]]</li>`
    			&tplInner=`@INLINE <ul id="submenu">[[+wrapper]]</ul>`
    			&tplInnerRow=`@INLINE <li><a href="[[+link]]">[[+pagetitle]]</a></li>`
    			&tplParentRow=`@INLINE <ul id="submenu">[[+wrapper]]</ul>`
    		]]
Читал, результат тот же
<pre class="pdoMenuLog">0.0078521: pdoTools loaded
0.0000420: xPDO query object created
0.0002062: Added selection of <b>modResource</b>: <small>SQL_CALC_FOUND_ROWS `id`, `pagetitle`</small>
0.0006330: Processed additional conditions
0.0014842: Added where condition: <b>template=16, OR:template:==13, modResource.parent:IN(0), modResource.parent:NOT IN(229,231,232,233,234,235,236,237,238,239,240), modResource.published=1, modResource.hidemenu=0, modResource.deleted=0, modResource.context_key=web</b>
0.0001390: Sorted by <b>modResource.menuindex</b>, <b>ASC</b>
0.0005319: SQL prepared <small>"SELECT SQL_CALC_FOUND_ROWS `modResource`.`id`, `modResource`.`pagetitle` FROM `modx_site_content` AS `modResource` WHERE  (  ( `modResource`.`template` = 16 OR `modResource`.`template` = 13 )  AND `modResource`.`parent` IN (0) AND `modResource`.`parent` NOT IN (229,231,232,233,234,235,236,237,238,239,240) AND `modResource`.`published` = 1 AND `modResource`.`hidemenu` = 0 AND `modResource`.`deleted` = 0 AND `modResource`.`context_key` = 'web' )  ORDER BY modResource.menuindex ASC "</small>
0.0000460: SQL executed
0.0000908: Total rows: <b>10</b>
0.0000191: Rows fetched
0.0000441: Returning raw data
0.0000129: Tree was built
0.0000122: Start template tree
0.0005910: Created inline chunk
0.0028558: End template tree
0.0003650: Created inline chunk
0.0145040: <b>Total time</b>
10 223 616: <b>Memory usage</b>
</pre>
Вызов сниппета:
[[!Login? &contexts=`msk,krasnodar` &loginContext=`web` &loginTpl=`lgnLoginTpl` &logoutTpl=`lgnLogoutTpl` &errTpl=`lgnErrTpl` &loginResourceId=`[[*id]]` &logoutResourceId=`[[*id]]`]]

Настройки контекста:
Базовый URL base_url: /
Хост контекста http_host: sub1.domain.dev
Хост для поиска multisite_http_host: sub1.domain.dev
Ключ авторизации multisite_site_group: auth
Главная страница site_start: 2
Адрес сайта site_url: http:// sub1.domain.dev

Плагин переключения контекстов, висящий на OnHandleRequest:
<?php
if($modx->context->key!="mgr")
{
    $object = $modx->getObject('modContextSetting', array('key' => 'multisite_http_host', 'value' => $modx->getOption('http_host')));
    if($object)
        $modx->switchContext($object->get('context_key'));
}


Не работает

Забыл уточнить, шаблон, в котором вызывается Login — один для всех контекстов