M
M
Maxim Voronkov2016-11-10 00:00:15
MODX
Maxim Voronkov, 2016-11-10 00:00:15

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.57898ad1be8947c4a8671e5186acc648.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Voronkov, 2016-11-14
@Voolyman

You need to install PdoTools and everything works in it!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question