# Mark child menu folder as active

**URL:** <https://discourse.gohugo.io/t/mark-child-menu-folder-as-active/19794>\
**Category:** support\
**Created:** [July 24, 2019, 6:39pm UTC](https://discourse.gohugo.io/t/mark-child-menu-folder-as-active/19794 "2019-07-24T18:39:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrmanfitz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mrmanfitz/32/9177_2.png) [@mrmanfitz](https://discourse.gohugo.io/u/mrmanfitz)\
**Post date:** [July 24, 2019, 6:39pm UTC](https://discourse.gohugo.io/t/mark-child-menu-folder-as-active/19794/1 "2019-07-24T18:39:08Z")

</div>

As a follow-up to this: [Another way to make a menu item active](https://discourse.gohugo.io/t/another-way-to-make-a-menu-item-active/17029)

That solution looks very close to what I’m trying to do, but I’d like a more generic solution that also works for child items in a sub-folder.

Has anyone accomplished this with nested menus?

Here is the folder structure I’m working with:

```
/nav/parent1/child1.md
/nav/parent1/child2.md
/nav/parent1/child_folder1/_index.md
/nav/parent1/child_folder1/child_folder_item1.md

```

Obviously when any child of a parent is displayed, that Parent menu will be expanded with that Child item highlighted. However, when I have another folder beneath that I want to display the “Child Folder Item 1” page, but highlight “Child Folder 1” in the menu and not display “Child Folder Item 1” in the menu. (I hope I explained that OK).

Here’s how I want the menu to look for Child Folder Item 1-n:

- Parent Item 1
  - Child Item 1
  - Child Item 2
  - **Child Folder 1**

- Parent Item 2
- Parent Item 3

---

<div class="post-metadata">

**Author:** ![brunoamaral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/brunoamaral/32/21144_2.png) [@brunoamaral](https://discourse.gohugo.io/u/brunoamaral)\
**Post date:** [July 24, 2019, 10:19pm UTC](https://discourse.gohugo.io/t/mark-child-menu-folder-as-active/19794/2 "2019-07-24T22:19:13Z")

</div>

wouldn’t the method in the documentation allow this?

```auto
{{ if ( $.Page.IsMenuCurrent "main" .) ( $.Page.HasMenuCurrent "main" .) }} active {{- end -}}

```

---

<div class="post-metadata">

**Author:** ![mrmanfitz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mrmanfitz/32/9177_2.png) [@mrmanfitz](https://discourse.gohugo.io/u/mrmanfitz)\
**Post date:** [July 25, 2019, 2:21am UTC](https://discourse.gohugo.io/t/mark-child-menu-folder-as-active/19794/3 "2019-07-25T02:21:20Z")

</div>

@brunoamaral I think that’s it! I’m sure I tried that before, but I think there was one additional missing piece.

In the front matter of the “Child Folder Item 1” file I had to change the “parent” property:

```
menu:
  nav:
    parent: child_folder1 <--- changed from "parent1"
    identifier: child_folder_item1
```
