{"id":1118,"date":"2006-03-24T19:49:00","date_gmt":"2006-03-25T00:49:00","guid":{"rendered":"http:\/\/blogs.devhorizon.com\/reza\/?p=1118"},"modified":"2006-03-24T19:49:00","modified_gmt":"2006-03-25T00:49:00","slug":"custom-site-definitions-vs-custom-templates","status":"publish","type":"post","link":"https:\/\/blogs.devhorizon.com\/reza\/2006\/03\/24\/custom-site-definitions-vs-custom-templates\/","title":{"rendered":"Custom site definitions VS Custom templates"},"content":{"rendered":"<p><P>When it comes to sharepoint deployment, site definitions are preferred the most. People often rely on site definitions more than custom templates. I agree that it gives you more control on every thing, but it is not always the best solution and it truly depends on what you want to accomplish. In this article I would try to give you a high level understanding of both solutions and you got to decide which one suits you the best.<\/P><br \/>\n<P><STRONG>1) Custom site definitions:<\/STRONG><\/P><br \/>\n<P>Advantages: <\/P><br \/>\n<UL type=disc><br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt\">Data is stored directly on the Web servers, so performance is typically better.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt\">Full control over look and feel of site<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt\">ASPX pages can be defined as ghosted modules. Ghosted files are not copied into site content and are directly read from site definition (They are stored in the directory in which site definition exists) and cached on the web server. Any changes to these files are automatically propagated to all sites which are based on the site definition. For example add \u201c<B> this is a changes<\/B>\u201d to default.aspx page in one of the site definitions (e.g: STS). You will see this in all default.aspx pages of the sites which are based on the site definition. As soon as you make a minor change to a ghosted file through Front page it becomes unghosted and added to the site\u2019s content.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt\">A higher level of list customization is possible through direct editing of a SCHEMA.XML file.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt\">Certain kinds of customization to sites or lists require use of site definitions, such as introducing new file types, defining view styles, or modifying the drop-down <B>Edit<\/B> menu.<\/LI><\/UL><br \/>\n<P>Disadvantages: <\/P><br \/>\n<UL type=disc><br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt\">Customization of site definition requires more effort than creating custom templates.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt\">Any error or inconsistency in site definition related xml files prevent site definition from working.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt\">Changes to site definitions must be done one by one and after each change you must restart IIS and check to see if your change has not broken anything.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt\">Most of site definition files are xml based and altering them requires a good understating of xml elements and attributes used in these file. However share point SDK fully covers them.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt\">I tried using ghosting with an HTML page , but it did not work because HTML pages are cached differently than ASP.NET pages.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt\">It is difficult to edit a site definition after it has been deployed.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt\">Doing anything other than <B style=\"mso-bidi-font-weight: normal\">adding<\/B> code can break existing sites (especially deletes).<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt\">Users cannot apply a SharePoint theme through a site definition.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt\">Users cannot create two lists of the same type with different default content.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo2; tab-stops: list 36.0pt\">Customizing site definitions requires access to the file system of the front-end Web server.<\/LI><\/UL><br \/>\n<P><STRONG>2) Custom templates<\/STRONG><\/P><br \/>\n<P>Advantages: <\/P><br \/>\n<UL type=disc><br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo3; tab-stops: list 36.0pt\">Custom templates are easy to create.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo3; tab-stops: list 36.0pt\">Almost anything that can be done in the user interface can be preserved in the template.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo3; tab-stops: list 36.0pt\"><I style=\"mso-bidi-font-style: normal\"><U>Custom templates can be modified without affecting existing sites that have been created from the templates. <?xml:namespace prefix = o ns = \"urn:schemas-microsoft-com:office:office\" \/><o:p><\/o:p><\/U><\/I><br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo3; tab-stops: list 36.0pt\">Custom templates are easy to deploy. All you need to do is to upload them to the template gallery of the site you wish to derive sub-sites from.<\/LI><\/UL><br \/>\n<P>Disadvantages: <\/P><br \/>\n<UL type=disc><br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo4; tab-stops: list 36.0pt\">Custom templates are not created in a development environment.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo4; tab-stops: list 36.0pt\">They are less efficient in large-scale environments.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo4; tab-stops: list 36.0pt\">If the site definition on which the custom template is based does not exist on the front-end server or servers, the custom template will not work.<br \/>\n<LI class=MsoNormal style=\"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo4; tab-stops: list 36.0pt\">Top-level sites cannot be created based on custom templates.<\/LI><\/UL><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When it comes to sharepoint deployment, site definitions are preferred the most. People often rely on site definitions more than custom templates. I agree that it gives you more control on every thing, but it is not always the best solution and it truly depends on what you want to accomplish. In this article I [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-1118","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Custom site definitions VS Custom templates - Reza Alirezaei&#039;s Blog %<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blogs.devhorizon.com\/reza\/2006\/03\/24\/custom-site-definitions-vs-custom-templates\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Reza Alirezaei\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/03\\\/24\\\/custom-site-definitions-vs-custom-templates\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/03\\\/24\\\/custom-site-definitions-vs-custom-templates\\\/\"},\"author\":{\"name\":\"Reza Alirezaei\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"headline\":\"Custom site definitions VS Custom templates\",\"datePublished\":\"2006-03-25T00:49:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/03\\\/24\\\/custom-site-definitions-vs-custom-templates\\\/\"},\"wordCount\":568,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/03\\\/24\\\/custom-site-definitions-vs-custom-templates\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/03\\\/24\\\/custom-site-definitions-vs-custom-templates\\\/\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/03\\\/24\\\/custom-site-definitions-vs-custom-templates\\\/\",\"name\":\"Custom site definitions VS Custom templates - Reza Alirezaei's Blog %\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\"},\"datePublished\":\"2006-03-25T00:49:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2006\\\/03\\\/24\\\/custom-site-definitions-vs-custom-templates\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/\",\"name\":\"Reza Alirezaei's Blog\",\"description\":\"Blogging from the field!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\",\"name\":\"Reza Alirezaei\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"caption\":\"Reza Alirezaei\"},\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/author\\\/rezaa\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Custom site definitions VS Custom templates - Reza Alirezaei's Blog %","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blogs.devhorizon.com\/reza\/2006\/03\/24\/custom-site-definitions-vs-custom-templates\/","twitter_misc":{"Written by":"Reza Alirezaei","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blogs.devhorizon.com\/reza\/2006\/03\/24\/custom-site-definitions-vs-custom-templates\/#article","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2006\/03\/24\/custom-site-definitions-vs-custom-templates\/"},"author":{"name":"Reza Alirezaei","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"headline":"Custom site definitions VS Custom templates","datePublished":"2006-03-25T00:49:00+00:00","mainEntityOfPage":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2006\/03\/24\/custom-site-definitions-vs-custom-templates\/"},"wordCount":568,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blogs.devhorizon.com\/reza\/2006\/03\/24\/custom-site-definitions-vs-custom-templates\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blogs.devhorizon.com\/reza\/2006\/03\/24\/custom-site-definitions-vs-custom-templates\/","url":"https:\/\/blogs.devhorizon.com\/reza\/2006\/03\/24\/custom-site-definitions-vs-custom-templates\/","name":"Custom site definitions VS Custom templates - Reza Alirezaei's Blog %","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#website"},"datePublished":"2006-03-25T00:49:00+00:00","author":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blogs.devhorizon.com\/reza\/2006\/03\/24\/custom-site-definitions-vs-custom-templates\/"]}]},{"@type":"WebSite","@id":"https:\/\/blogs.devhorizon.com\/reza\/#website","url":"https:\/\/blogs.devhorizon.com\/reza\/","name":"Reza Alirezaei's Blog","description":"Blogging from the field!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blogs.devhorizon.com\/reza\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938","name":"Reza Alirezaei","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","caption":"Reza Alirezaei"},"url":"https:\/\/blogs.devhorizon.com\/reza\/author\/rezaa\/"}]}},"_links":{"self":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/1118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/comments?post=1118"}],"version-history":[{"count":0,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/1118\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/media?parent=1118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/categories?post=1118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/tags?post=1118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}