Answer the question
In order to leave comments, you need to log in
How to make an active menu for WebLink?
Good evening.
The menu is displayed through the Wayfinder component. Links are rendered via resource type: links
For this resource type, Wayfinder does not assign an active class. I try to edit wayfinder.class.php, but there is a problem that the class began to appear on all links.
if ($type == 'modWebLink') {
$docId = $this->modx->resource->get('id');
print_r($docId);
if (!empty($this->_css['here']) && $this->isHere($docId)) {
$returnClass .= $hasClass ? ' ' . $this->_css['here'] : $this->_css['here'];
$hasClass = 1;
//print_r($docId);
//print_r ($this->modx->resource->get('id'));
}
}
The comparison is done by id, but since the id of the link is different, you just need to substitute id = content.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question