Both the Wayfinder versions for Evo and Revo would not give the class
last to a single ("only child") menu item (not having any siblings). For many users it's a natural expectation to get the class
last for such an item too (as it is the case for the class
first).
The culprit for this behaviour is this condition within the function
buildSubMenu in the file
wayfinder.inc.php (line 93 in the Evo version, line 224 in the Revo version, counted by Notepad++):
if ($counter == ($numSubItems) && $numSubItems > 1) {
$docInfo['last'] = 1;
} else {
$docInfo['last'] = 0;
}
As a workaround the second part of the condition,
$numSubItems > 1, should be omitted:
if ( $counter == $numSubItems ) {
$docInfo['last'] = 1;
} else {
$docInfo['last'] = 0;
}
To be even more flexible, two new boolean properties ( with values 0|1 ) would be desireable, e.g.
&singleFirst and
&singleLast.
They have to determine if single items would get the class
first (
&singleFirst=`1`) or not (
&singleFirst=`0`) - and similar for the class
last.
The default values both should be set to `1` (the natural choice, I think) - or, for the sake of downward compatibility, chosen to reflect the actual behaviour of Wayfinder.
Edit:
I also opened a Ticket for this:
http://tracker.modx.com/issues/8537
(Modified thread titel here - the " had eaten part of the line)
[ed. note: ottogal last edited this post 11 years, 8 months ago.]