When using page nesting, you may need to hide parts of the parent page. Kentico provides several ways to achieve this goal:
Using the "Page nesting" settings
- Open the Pages application.
- Select the /News page and open the Properties -> Template tab.
- Click Edit template properties.
- Set the Page nesting value to None. This means that the page does not use any nesting, so the content from the site's root (master page) is not visible.
- Click Save to confirm the changes.
When you close the dialog and view the News page in Preview mode or on the live site, the page does not display the shared content from the master page.
To return the page to its original state, edit the template again and set the Page nesting value to Only the nearest master page.
You can also set the page nesting for individual pages using the Properties -> Template tab. The nesting settings you configure for documents override the settings of the assigned page template.
Using the "Hide on subpages" web part property
Every web part has a property called Hide on subpages.
- In the Pages application, edit a parent page on the Design tab.
- Configure (double-click) the web part you want to hide.
- Expand the Visibility category, and enable Hide on subpages.
- Click OK.
The web part is hidden on all pages where it is inherited from an ancestor page.
Using the "Show for document types" web part property
The Show for document types web part property allows you to limit which document types display the given web part. To see how this works:
- In the Pages application, select /Community/Blogs/Andrew Jones Blog in the content tree.
- On the Design tab, configure (double-click) the Header text, Description text or Blogs filter web part.
All of the web parts have the Show for document types property set to CMS.BlogMonth;CMS.Blog (in the Visibility category). This means that the web parts only appear on blog month and blog documents, not on individual blog posts, which are stored under blog months.
- Click Cancel.
Switch to Preview mode. The header text, description text and filter are all displayed above the repeater displaying blog posts.
Click a specific blog post. The web parts are not visible, because the CMS.BlogPost is not among the allowed document types.