Skip to content

Commit

Permalink
Fix flat menu directive for current URL
Browse files Browse the repository at this point in the history
  • Loading branch information
jawngee committed Oct 8, 2020
1 parent 8817118 commit ddf08b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Classes/External/Blade/Directives/FlatMenuDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public static function OutputFlatMenu($slug, $wrap = '') {

if (trim($menuItem['url'],"/") == $current_url) {
$menuItem["classes"][] = "current";
} else if (strpos($current_url, trim($menuItem['url'], '/')) === 0) {
$menuItem["classes"][] = "current";
}

if (strpos($menuItem['url'],'#') === false) {
Expand Down Expand Up @@ -120,4 +122,4 @@ public function execute($args) {

return "<?php echo Stem\\External\\Blade\\Directives\\FlatMenuDirective::OutputFlatMenu('{$args[0]}', '{$wrap}'); ?>";
}
}
}

0 comments on commit ddf08b6

Please sign in to comment.