Visual inheritance

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

As you can see in the topic The master page concept, the content of sub-pages is displayed within the master page or generally within any parent page using the Page placeholder web part. The result of this approach is that the sub-page content is "nested" inside the content of the parent pages.


In some cases, you may want to hide some parts of the parent page. There are several ways how to achieve that:


Using the "Inherit content" property of the page template


Click the /News page and click Properties -> Template -> Edit template properties. Now you can set the Inherit content value to Selected inherited levels and check only the Level1 box. It means that only the content from the first level of the content hierarchy will be displayed and the master page (root) is not inherited. Click OK to save the changes.




The page will now look like this:




Set the Inherit content value back to Level0 for now.


Similarly, you can set the content inheritance on the level of individual pages using the Properties -> Template dialog. The content inheritance settings you configure for the page override the page template settings:




Using the "Hide on sub-pages" web part property


Click /News, switch to the Design tab and click the Configure (Configure) button of the HeaderText web part. The web part has the property Hide on sub-pages set to true:




Click Cancel and click Live site. Please note that when you display the list of news, the title News is displayed:




If you go to some particular news item, the title is hidden:




This is ensured by the Hide on sub-pages property that hides the web part displaying the News title.


Using the "Show for document types" web part property


The Show for document types property allows you to define a list of document types for which the web part will be displayed. Click /News, click Design and click configure in the BreadCrumbs web part. The Show for document types field is set to the News document type. Click Cancel.




Go to the live site, to the /News page. The breadcrumb navigation is hidden since the currently selected document type is a page:




When you go to some particular news item, the currently selected document is a news item and the breadcrumb navigation is displayed:




You have learned how to break inheritance of content and how to display content based on the current document type.


Page url: