Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Site Definition vs. Site Template for customization

  Asked By: Evelyn    Date: Jan 13    Category: Sharepoint    Views: 13843

Does anyone want to weigh in on what criteria someone should use to determine whether they should do their customizations as a site definition or a site template – or why to use both?

I’m trying to get an article together put together fairly quickly on why one might choose to do their customizations in a site template vs. a site definition. I’d love to get everyone’s input.

(The objective is to create an article comparing these two options much like the user controls vs. web parts article that I wrote for Intranet Journal which is available at www.intranetjournal.com/.../ij_01_20_06a.html).




10 Answers Found

Answer #1    Answered By: Lacey Daniels     Answered On: Jan 13

I would almost always choose  a Site Definition, maybe I am "Old
School" but I like have the physical aspx file on the file system of
the SharePoint server. The advantage of having the physical file is
that you can use any tool you want to edit the aspx file (I prefer a
plain text editor) and you can backup/restore a physical file much
easier than a block of data stored somewhere in the SharePoint
database. As most people know storing the aspx file in the database
is refered to as "Unghosted", which means you have to use Front Page
to make any edits to the page, performance will take a hit and the
backup/restore process is no longer just a simple file restore.

The only time I would use a Site Template is if I needed the content
as well as the look and feel. Site Templates will move custom lists,
meta data and list data itself (I am pretty sure of that). Site
Definitions are just the look and feel (no data).

Answer #2    Answered By: Ariana Christensen     Answered On: Jan 13

I like to think of a custom Web Template (STP) as a macro on top of a
Site Definition. The value of using them is scope (site collection vs.
global only) and the ability to overcome some pesky irritations of
custom site  definitions. In the end, every Web (Area too) weather
provisioned and templatized using a configuration of a site definition
or a custom Web Template is ultimately dependant upon a specific site
definition. The custom Web Template is an intermediate means to an end.
They certainly do have their place.

Answer #3    Answered By: Darrius Whitfield     Answered On: Jan 13

To me, site  definitions are a way to do customizations, whereas site template  are a way to spread customizations. I say it much more eloquently in a Word file somewhere, but the general gist is definitions create, templates propagate.

Since you can't go back and update a site template and in turn affect all sites based of that site template, to me they are strickly for spreading your customizations, best use being role based changes. (I have a post half written I need to put  on my blog about role based templates). But bascially, you identify a need, you tweak a site to meet that need (via lists or whatever), package up that solution and then propogate it to many sites in the form of a template.

If you need to adjust the branding or the look of a site, that needs to be done with site definitions, or better yet just with CSS and images.

Answer #4    Answered By: Adrienne Greene     Answered On: Jan 13

I’ve not acknowledged your previous message yet so … thank you. I found a few gems that I forgot about (for some reason they were too obvious for me to even realize).

As for the schema file, the only thing that I have found slightly useful is the SharePoint CAML Schema definition  on gotdotnet (www.gotdotnet.com/.../workspace.aspx)

As for this message, I typically instantiate sites from code through a globally installed template  (stsadm –o addtemplate) so that we can leverage site  templates where possible and modify the underlying site definition where we have to. The naming of global templates is goofy but it at least gets you past the limitation of being able to use a template only within a site collection.

I describe templates as accessories for a car. It controls  whether you have a CD player or not, however, it doesn’t define the basic structure for the car. The basic structure for the car comes from the site definition – no matter what kind of accessories you add to (or take away from) the car.

Answer #5    Answered By: Joshuah Huber     Answered On: Jan 13

For what it’s worth, I sent you a message to your other email address with this very thought in mind ;) I was hoping you could do the article  instead of me.

Answer #6    Answered By: Ciara Collier     Answered On: Jan 13

I drift towards site  Definitions myself … but that’s because most of my customers are very large. However, I actually, use both a site definition  and a site template. I put  the site template  on the site definition so the users can easily manipulate the web  parts on the default pages.

As a sidebar, you can define data in a site definition, it’s just a tad bit more challenging to do – it’s right to do it with site templates.

Answer #7    Answered By: Keenan Whitehead     Answered On: Jan 13

I never received it....................

Answer #8    Answered By: Peter Peterson     Answered On: Jan 13

Of course, I use AddTemplate too (wish it worked for list templates).
But the fact that custom Web templates are scoped to a site  collection
can be extremely handy. In fact, more often than using AddTemplate, I've
created a custom Web template  from my custom site definition, not to
customize it, but just so that it would only be local in scope.

Your "accessories for a car" analogy seems to work. It took me a few
minutes to feel comfortable with it but I can't find any glaring flaws
with it. I suppose that a new custom list is like a CD player. And a new
links list is like adding more cup holders to the ones that exist. And
applying a theme is like painting flames on the doors (I won't do that
either). Adding Web Parts to the existing pages is like putting in a
skylight or using custom mirrors. I had trouble coming up with what
adding data into an existing list is like; putting your CD jewel cases
into the CD holder or throwing "valuables" into the glove compartment?

Answer #9    Answered By: Damon Garner     Answered On: Jan 13

How about putting gas in the gas tank? I suppose one could argue that it's not
an accessory.

Answer #10    Answered By: Christop Mcfadden     Answered On: Jan 13

Yep. That's why I equated it to filling the CD holder with jewel cases.

Didn't find what you were looking for? Find more on Site Definition vs. Site Template for customization Or get search suggestion and latest updates.