Hiding pages

You can 'hide' a page in the site structure, by clicking on page title and choosing "Hidden" from its dropdown menu. What does this do?

Specifically, this means that when you're iterating over all the pages in the site (Page.all_pages) in your templates, you will not encounter this page or any of its children. So they won't appear in nav bars or site map or the like.

If you go directly to the URL for the hidden page (say, http://example.com/home/news), you'll get a 404. If you go to a specific action for the page (say, http://example.com/home/news/tag/birthdays), the action will succeed. Only the default action is unavailable for the hidden page.

This behaviour is identical for any page that descends from a hidden page — ie, the child or grandchild or etc of the hidden page.

User notes

(You can add notes to this page using the form below.)

Joseph [Mon 16 Feb 2009, 1:45PM]

The current arrangement allows you to have a hidden search page, a search form in an ingredient, and still access the 'results' action for that page.

Could it be better? Should the default route be hidden at all? Currently, it can be easily circumvented by appending 'index' to the URL...

Or should we make the entire page inaccessible, but children fully accessible? This change would not be backwards compatible with many sites, and requires that the code distinguish between "visible", "hidden" and "visible-with-a-hidden-parent". Which is fine, but might be confusing for template developers.

Happy to field opinions.


Only the note field is required.

Preview or