locked
Master Pages vs. Templates RRS feed

  • Question

  • Okay, I understand that Master Pages are in place to control the look and feel of a site in order to give a uniform and feel.  I am confused though is this not the same thing that a Template is supposed to be used for?  When would one use a Master Page as opposed to a Template?  Whan would a template be used?
    Thursday, July 30, 2009 5:21 PM

Answers

  • Hi

     

    A Dynamic Web Template is an HTML-based master copy of a web page that you can create to contain settings, formatting, and page elements such as text, graphics, page layout, styles, and regions of a web page that can be modified. When you attach a Dynamic Web Template to the pages in a website, that template defines the layout for those pages. You can use any number of Dynamic Web Templates in a website, and you can attach a Dynamic Web Template to as many pages as you like.

     

    ASP.NET master pages enable you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you want for all of the pages (or a group of pages) in your application. You can then create individual content pages that contain the content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.

     

    Per my knowledge, Dynamic Web Template are used in HTML pages which ASP.NET master pages accompanies with .Net technology and used with ASPX pages.

     

    I quoted the comparison from ASP.NET master pages for your information:

     

    Both master pages and Dynamic Web Templates allow you to create a consistent layout that can easily be updated in all the pages in your site. If you are working with ASP.NET files, use master pages to define a consistent look with shared content across pages. If you are working with HTML files, use Dynamic Web Templates.

    Master Pages

    Dynamic Web Templates

    Use with .aspx files

    Use with .htm or .html files

    Master content and page content are merged on the server when the page is requested

    Template content exists in all pages based on the template and must be updated in all pages whenever the template is updated

    Individual page content must be between <asp:contentplaceholder> and </asp:contentplaceholder> tags

    Individual page content must be between <!-- #BeginEditable --> and <!-- #EndEditable --> tags

     

    Hope the information can be helpful.

    -lambert


    Sincerely,
    Lambert Qin | Microsoft TechNet Managed Forum Support
    Posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, August 3, 2009 3:05 AM

All replies

  • If you mean a site template:
    Site templates are used to generate new sites with all sorts of functionality. This can be lists, libraries and such.
    Master Pages only control layout, page components etc.

    Danny Burlage
    http://www.bposrocks.com
    Thursday, July 30, 2009 11:07 PM
  • Hi,

    It depends on what you mean by template. If you mean a site template, Danny Burlage is right. A site template is a site that was customized and branded then saved (with its content such as pages, master pages, documents, images, features, etc.) as a template in order to create other sites from it. The downside of a site template is that if in the future you try to change it, these changes are not applied to the sites created from it. Plus, it's not always possible to save a site as a template. Publishing sites does not have this feature.

    If you are talking of a template as site definition such as the OOTB ones like "Team site", "Wiki", "Blank site", etc. The master page is just a part of it amongst other parts. The advantage of site definitions is that they are saved on disk and that you can create your own and deploy it as a sharepoint solution (WSP). For future branding you have just to update you site definition.

    May be this article will help you : http://blogs.msdn.com/brianwilson/archive/2008/07/13/site-definitions-versus-site-templates-and-deciding-on-the-correct-customization-approach.aspx

    Finally, No matter how you have created your site, from site template, a custom site definition or an OOTB template, you can always change its master page via a feature.

    Regards,

    Djamel Chagour

    My Blog - http://spbyexamples.blogspot.com/
    Friday, July 31, 2009 12:29 AM
  • My apologies for not being clearer. I was referring to Dynamic Web Templates (DWT) vs. Master Pages.
    Friday, July 31, 2009 12:57 PM
  • Hi

     

    A Dynamic Web Template is an HTML-based master copy of a web page that you can create to contain settings, formatting, and page elements such as text, graphics, page layout, styles, and regions of a web page that can be modified. When you attach a Dynamic Web Template to the pages in a website, that template defines the layout for those pages. You can use any number of Dynamic Web Templates in a website, and you can attach a Dynamic Web Template to as many pages as you like.

     

    ASP.NET master pages enable you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you want for all of the pages (or a group of pages) in your application. You can then create individual content pages that contain the content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.

     

    Per my knowledge, Dynamic Web Template are used in HTML pages which ASP.NET master pages accompanies with .Net technology and used with ASPX pages.

     

    I quoted the comparison from ASP.NET master pages for your information:

     

    Both master pages and Dynamic Web Templates allow you to create a consistent layout that can easily be updated in all the pages in your site. If you are working with ASP.NET files, use master pages to define a consistent look with shared content across pages. If you are working with HTML files, use Dynamic Web Templates.

    Master Pages

    Dynamic Web Templates

    Use with .aspx files

    Use with .htm or .html files

    Master content and page content are merged on the server when the page is requested

    Template content exists in all pages based on the template and must be updated in all pages whenever the template is updated

    Individual page content must be between <asp:contentplaceholder> and </asp:contentplaceholder> tags

    Individual page content must be between <!-- #BeginEditable --> and <!-- #EndEditable --> tags

     

    Hope the information can be helpful.

    -lambert


    Sincerely,
    Lambert Qin | Microsoft TechNet Managed Forum Support
    Posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, August 3, 2009 3:05 AM