New #nav.hasVisibleSubFolders Function

As it currently stands, we only have the function #nav.hasSubFolders() which only checks whether there are any subfolders in the structure, but not if those folders are actually to be displayed in the navigation or not (via checkbox on the folder).

This has proven to be an issue multiple times according to these community posts:

https://community.crownpeak.com/t5/Questions-Answers/Hat-die-aktuelle-Seite-Kinder-die-in-der-Navigation-sind/m-p/31492
https://community.crownpeak.com/t5/Questions-Answers/Pr%C3%BCfen-auf-Unterordner-Subfolder-und-ob-di...
https://community.crownpeak.com/t5/Questions-Answers/How-can-nav-hasSubFolders-be-false-across-three...
https://community.crownpeak.com/t5/Questions-Answers/Frage-zur-Navigation-Anzahl-der-Elemente-eines-...
https://community.crownpeak.com/t5/Questions-Answers/Anzahl-der-Unterordner-Subfolder-in-Navigation-...

What I would ask for is a #nav.hasVisibleSubFolders function that specifically only checks for subfolders that are supposed to be in the navigation.

EDIT:

Our current workaround (for reference)

$CMS_SET(set_hasVisibleSubFolders,false)$
$CMS_FOR(subfolder,#nav.folder.getChildren(class("de.espirit.firstspirit.store.access.sitestore.PageRefFolderImpl"),false))$
  $CMS_IF(subfolder.getFolderLangSpec(#global.language).isVisible())$
    $CMS_SET(set_hasVisibleSubFolders,true)$
    $CMS_SET(void, #for.BREAK)$
  $CMS_END_IF$
$CMS_END_FOR$
$CMS_IF(set_hasVisibleSubFolders)$
  DO STUFF
$CMS_END_IF$
Tags (1)