@IgorRastarov

Как сделать ссылку в меню не активной в MODX?

Всем привет. Сайт на modx. У меня есть Верхнее меню, которое задается с помощью Wayfinder.
Вот чанк:
<div class="nav-col">
[[!Wayfinder? &startId=`0` &outerTpl=`topmenu_outerTpl`
		&innerTpl=`Wayfinder.innerTpl`
		&parentRowTpl=`Wayfinder.parentRowTpl`
		&innerRowTpl=`Wayfinder.innerRowTpl`
		&rowTpl=`Wayfinder.rowTpl`    &includeDocs=[[getResources?  &parents=`0`  &depth=`3`  &limit=`0`  &tpl=`@INLINE [[+id]]`  &outputSeparator=`,` &tvFilters=`menuplace==%top%`]]]]
</div>

Вот сниппет Wayfinder:
<?php
$wayfinder_base = 
$modx->getOption('wayfinder.core_path',
$scriptProperties,$modx->getOption('core_path').'components/wayfinder/');
/* include a custom config file if specified */
if (isset($scriptProperties['config'])) {
    $scriptProperties['config'] = str_replace('../','',$scriptProperties['config']);
    $scriptProperties['config'] = $wayfinder_base.'configs/'.$scriptProperties['config'].'.config.php';
} else {
    $scriptProperties['config'] = $wayfinder_base.'configs/default.config.php';
}
if (file_exists($scriptProperties['config'])) {
    include $scriptProperties['config'];
}
/* include wayfinder class */
include_once $wayfinder_base.'wayfinder.class.php';
if (!$modx->loadClass('Wayfinder',$wayfinder_base,true,true)) {
    return 'error: Wayfinder class not found';
}
$wf = new Wayfinder($modx,$scriptProperties);
/* get user class definitions
 * TODO: eventually move these into config parameters */
$wf->_css = array(
    'first' => isset($firstClass) ? $firstClass : '',
    'last' => isset($lastClass) ? $lastClass : 'last',
    'here' => isset($hereClass) ? $hereClass : 'active',
    'parent' => isset($parentClass) ? $parentClass : '',
    'row' => isset($rowClass) ? $rowClass : '',
    'outer' => isset($outerClass) ? $outerClass : '',
    'inner' => isset($innerClass) ? $innerClass : '',
    'level' => isset($levelClass) ? $levelClass: '',
    'self' => isset($selfClass) ? $selfClass : '',
    'weblink' => isset($webLinkClass) ? $webLinkClass : ''
);
/* get user templates
 * TODO: eventually move these into config parameters */
$wf->_templates = array(
    'outerTpl' => isset($outerTpl) ? $outerTpl : '',
    'rowTpl' => isset($rowTpl) ? $rowTpl : '',
    'parentRowTpl' => isset($parentRowTpl) ? $parentRowTpl : '',
    'parentRowHereTpl' => isset($parentRowHereTpl) ? $parentRowHereTpl : '',
    'hereTpl' => isset($hereTpl) ? $hereTpl : '',
    'innerTpl' => isset($innerTpl) ? $innerTpl : '',
    'innerRowTpl' => isset($innerRowTpl) ? $innerRowTpl : '',
    'innerHereTpl' => isset($innerHereTpl) ? $innerHereTpl : '',
    'activeParentRowTpl' => isset($activeParentRowTpl) ? $activeParentRowTpl : '',
    'categoryFoldersTpl' => isset($categoryFoldersTpl) ? $categoryFoldersTpl : '',
    'startItemTpl' => isset($startItemTpl) ? $startItemTpl : ''
);

/* process Wayfinder */
$output = $wf->run();
if ($wf->_config['debug']) {
    $output .= $wf->renderDebugOutput();
}

/* output results */
if ($wf->_config['ph']) {
    $modx->setPlaceholder($wf->_config['ph'],$output);
} else {
    return $output;
}

Меню такое:
Главная О нас Доставка Продажи Клиентам
Мне надо сделать так, чтобы когда я нахожусь на главной странице, пункт главная был не активен (не был ссылкой)
Как это сделать?
  • Вопрос задан
  • 1113 просмотров
Решения вопроса 1
@artr_lr
Через pdomenu сделал так:
[[pdoMenu?
  &parents=`родитель`
  &tplOuter=`@INLINE <ul class="list">[[+wrapper]]</ul>`
  &tpl=`menuParse`
]]

где menuParse
[[+link:is=`[[*uri]]`:then=`<li><span>[[+menutitle]]</span></li>`:else=`<li><a href="[[+link]]">[[+menutitle]]</a></li>`]]
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
@masterfreelance
программист со стажем
если нужно не отображать ссылку для всех текущих ресурсов, а не только для главной - используй &hereTpl
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы