Sitefinity CMS

Pages Overview Send comments on this topic.
See Also
Sitefinity Building Parts > Pages > Pages Overview

Glossary Item Box

Pages are what every Web site is made of. Therefore, Pages are one of the major parts of Sitefinity. As already discussed in the topic Sitefinity Architecture, there are some peculiarities about Pages in Sitefinity that will be covered by this topic.

 

What are Pages in Sitefinity?

Pages in Sitefinity can be thought of as containers. These containers hold Controls which, in turn, provide the actual content. While developer define Pages as containers for controls, end-users find no difference between Sitefinity pages and classic HTML pages.

For more information on the difference between Sitefinity pages and classic HTML pages, see Table 1 in the topic "Sitefinity Architecture".

Together, all pages form a Sitemap. Each page individually is defined through properties, template, theme and controls. For an illustration of this, see Figure 1:

Pages Overview

Figure 1 – Sitemap and Page Definition

 

How Can Pages be Modified?

The only way to directly modify a page is by using the Sitefinity Page Editor. Namely, Pages in Sitefinity are created on the fly and there are no underlying files that can be opened and modified. The fact that pages are created on the fly gives an unrivaled amount of flexibility for every developer, designer or power user, and represents a truly innovative solution.

For more information on the assumed differentiation between this manual's readers or Sitefinity users, see Readers Guidelines

Here are a few examples:

  1. User decides that all the pages should have their title starting with “Our Company >”. This has not been the case before and there are 60,000 pages already on the site. Instead of going manually through all 60,000 pages and modifying the files, an API method can be used that would insert the new text in the title in a matter of seconds.
  2. Marketing team demands different color schemes during the winter season and summer season. Through the API this process can be automated and color schemes can be changed on countless pages without ever needing a human intervention.
  3. Non-technical users should be able to create new pages without having to work with Master Pages or style sheets. Through Sitefinity’s innovative page editor, users assemble pages from Master Pages, style sheets and controls - on the fly - without ever seeing a line of code.

 

What Kinds of Properties do Pages have?

Pages expose properties that are only related to the page as a whole. The properties are not related to the appearance of the page, the content of the page or even the functionality of the page. Following are a few examples of the kind of properties each page exposes:

  • Page Name – name of the page and respectively the URL this page will have
  • Show In Navigation – if true this page will be displayed in navigation; otherwise false
  • Keywords – keywords used to describe this page
  • Anonymous access (allow/deny) – should the page be available to users that have not logged in?

 

How is the Page Layout Defined?

The layout of every page is defined through a template. Templates in Sitefinity are generated from standard ASP.NET Master Page files. For every ContentPlaceHolder inside of a MasterPage, Sitefinity will generate an area where users can drag controls. Take a look at the following image in Figure 2 to see the relation between ContentPlaceHolder tags and areas at which controls can be dragged:

Pages Overview - Tags

Figure 2


So, there is absolutely no learning curve when creating templates for Sitefinity. All it takes is to create a MasterPage and upload it to Sitefinity.

 

How is a Page Function or Content Defined?

Adding page functionality or content is a natural build-up on the previous topic. Once the page has been created, its initial properties have been set and the template chosen, we need to add the content. In the previous step, we have explained which are the areas of the page where Controls can be added. It is exactly through those controls that we are going to define the functionality and/or content of the page.

Let’s assume we are creating a “news” page. In order to make the page display news, we are going to drag the “NewsView” control from the toolbox onto the page. If we are to create Forums page, we would drag the “Forums” control from the toolbox onto the page.

 

What Defines the Look and Feel of a Page?

The last step in the creation of a page is its look and feel. Once again, Sitefinity is following the well known ASP.NET practice – App_Themes. All that needs to be done to use a theme in Sitefinity is add a new theme to the App_Themes folder of the Sitefinity project. All the stylesheet files, skin files and any other related files will be automatically applied to a page.

 

Summing Up: Final Question - How Can Pages be Modified?

After examining the different aspects of a Sitefinity page, the short answer to the question is: Depends!

If we want to remove the page from navigation, we need to set its “ShowInNavigation” property to false.

If we want to add additional column to our page, we need to modify its template (more precisely, Master Page file from which the template has been generated).

If we want to change the content or function of the page, we’ll need to modify controls – or remove some controls and add some new controls.

Finally, if we’d like to change the background color of the page and change the typeface, we’ll need to modify the Theme of a page.

 

If it now seems unnecessarily complicated because everything is separated, it is worth taking a moment and pondering on the scenario where we need to change the typeface on 60,000 pages, but not change anything else – or alternatively scary – the scenario where we need to change the layout of 60,000 pages but keep everything else the same. In both of these scenarios, we’d be able to make changes quickly and error-free by modifying only one aspect of the pages, without changing anything else.


 

See Also