Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 5.1.5 - Unreleased
### Fixed
- Headings should never be marked as active ([#86](https://github.com/studioespresso/craft-navigate/issues/86)

## 5.1.4 - 2025-05-29
### Fixed
- Fix for updating url node values ([#82](https://github.com/studioespresso/craft-navigate/issues/82))
Expand Down
14 changes: 8 additions & 6 deletions src/models/NodeModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public function rules(): array

/**
* Added to make migrating from amNav easier
* @since 2.6.0
* @return mixed
* @throws \craft\errors\DeprecationException
* @since 2.6.0
*/
public function listClass()
{
Expand All @@ -105,9 +105,9 @@ public function listClass()

/**
* Added to make migrating from amNav easier
* @since 2.6.0
* @return mixed
* @throws \craft\errors\DeprecationException
* @since 2.6.0
*/
public function hasChildren()
{
Expand All @@ -130,13 +130,14 @@ public function active()
if (substr("/" . Craft::$app->request->getPathInfo(), 0, strlen($this->url)) === $this->url) {
return true;
}

break;
case 'heading':
return false;
default:
if ($this->url === Craft::$app->request->getAbsoluteUrl()) {
return true;
}

if (strpos(Craft::$app->request->getAbsoluteUrl(), '?')) {
if (explode('?', Craft::$app->request->getAbsoluteUrl())[0] === $this->url) {
return true;
Expand All @@ -163,13 +164,14 @@ public function current()
if (substr("/" . Craft::$app->request->getPathInfo(), 0, strlen($this->url)) === $this->url) {
return true;
}

break;
case 'heading':
return false;
default:
if ($this->url === Craft::$app->request->getAbsoluteUrl()) {
return true;
}

if (strpos(Craft::$app->request->getAbsoluteUrl(), '?')) {
if (explode('?', Craft::$app->request->getAbsoluteUrl())[0] === $this->url) {
return true;
Expand Down