@jrzav, @Karmalakas, Maybe the following might shed some light…
What does what with respect to a page’s ‘visibility’ property and hidden/visible menu-items?
- ‘Folder Numeric Prefix’
- Enabling field ‘Folder Numeric Prefix’ only adds a numeric prefix to the folder containing the page file. Disabling removes the numeric prefix.
- It does not ‘set’ the visibility or anything else of a page.
- ‘Sortable pages’
- This array field, allows the user to order siblings having a numeric prefix. It changes the order, by changing the numeric prefixes of the folders.
- It does not ‘set’ anything else.
It is the core that sets the page’s visibility property depending the page’s frontmatter and attributes of its folder.
When a page gets initialized it runs (amongst others) the following methods that impact property ‘Page::visible’. In order of execution:
Sets ‘Page::visible’ according the value set in frontmatter
If ‘Page::visible’ has not yet been set, set it according the presence of numeric prefix of folder.
- Page::modularTwig(strpos($this->slug(), ‘_’) === 0);
Sets ‘Page::visible’ to false if is a modular page.
If Page::published is false, set Page::visible to false
A collection adds pages according the ‘items’ field in the definition. It does not discriminate between visible/invisible. Both are added.
It provides functions ‘Collection::visible()’ and ‘Collection::invisible()’ to filter based on the value of ‘Page::visible’
A menu is only defined in a template. A template can create a menu as it sees fit. Usually, a collection of pages is being used to create the menu. In particular the collection of children of a page: ‘page.children’. And more specifically only the visible children: ‘page.children.visible’.
- Showing/hiding menu-items based on property ‘Page::visible’ is a convention.
- Only the templates, by adhering to the convention, shows/hides menu-items. Not Admin, nor core.
- Enabling/disabling ‘Folder Numeric Prefix’ in Admin, may have the side effect that a page is shown or not shown in the menu.
NB: Please correct me if my view on this should be corrected…