# Detect: $page-\>isOpen() only when page is really open, not children

**URL:** <https://forum.getkirby.com/t/detect-page-isopen-only-when-page-is-really-open-not-children/19559>\
**Category:** Questions\
**Tags:** v3\
**Created:** [September 29, 2020, 1:35pm UTC](https://forum.getkirby.com/t/detect-page-isopen-only-when-page-is-really-open-not-children/19559 "2020-09-29T13:35:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dennissnellenberg](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/dennissnellenberg/32/11680_2.png) [@dennissnellenberg](https://forum.getkirby.com/u/dennissnellenberg)\
**Post date:** [September 29, 2020, 1:35pm UTC](https://forum.getkirby.com/t/detect-page-isopen-only-when-page-is-really-open-not-children/19559/1 "2020-09-29T13:35:36Z")

</div>

I like to use the following functionality:  
`<li class="<?= r(page('commerce')->isOpen(), 'active') ?>">`

But I don’t want to have the `<li>` item .active when the children are open.  
Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 29, 2020, 2:02pm UTC](https://forum.getkirby.com/t/detect-page-isopen-only-when-page-is-really-open-not-children/19559/2 "2020-09-29T14:02:53Z")

</div>

There are two different methods:

` isOpen()` is used to check if the page itself or its descendants are active.  
` isActive()` on the other hands only checks if a page is actually active.
