WonderCMS / wondercms

Fast and small flat file CMS (5 files). Built with PHP, JSON database.
https://wondercms.com
MIT License
642 stars 163 forks source link

database.js: Page visibility indicator #301

Open joho1968 opened 12 months ago

joho1968 commented 12 months ago

Looking at "menuItems" and "menuItems > subpages", I see there's "visibility". But looking at "pages" and "pages > subpages", there's no such setting. So I'm guessing this means I first have to traverse the "menuItems" and "menuItems > subpages" to know if a given page is visible or not, if I need to figure that out for some reason. Is that correct? :thinking:

It'd be nice if there was a "visibility" setting on each actual page node.

robiso commented 8 months ago

Yes, you are correct, this is possible by checking the menuItems themself. We don't have visibility per page, as the visibility does not affect the visibility of the page. The visibility in menu items declares whether the page is visible in the menu or not (there are no "hidden" pages, and anyone can access those pages, even if their visibility is set to "invisible/hidden" :)

joho1968 commented 8 months ago

OK. I think the possibility to hide a page may make sense, for example to "disable a page" temporarily instead of deleting it.