For Programmers: Free Programming Magazines  


Home > Archive > Sharepoint Windows Services Development > October 2005 > Theme as default









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Theme as default
Miguel Ballesteros

2005-08-11, 5:05 pm

Hi!, I'v been working in a coulple of site templates in WSS, defined as a new
folder in the 1033 folder (the same location where STS and MPS are). The
templates are working fine!

Now, I need those site templates to use a specific Theme by default when a
new site is created. I checked the HTML code in the default.aspx page before
and after the Theme was applyed in a new site, but don't see any difference
related with themes. Ok... the new site has a new folder named _theme, but
there's no visible difference in the pages code.

Does anyone know how to configure a site template to use a specific Theme as
default for new sites in WSS?

Thanks for any help

--
Miguel.

Heather Solomon

2005-08-11, 5:05 pm

First, I believe you are talking about site definitions, not site templates.
There is a big difference in the terms when it comes to SharePoint.

Themes are applied to sites on a site by site basis. I don't know of a way
to automatically apply a theme on site creation.

Your best bet is to make the design changes to your custom site definition,
and not break up the process into two steps (custom site, custom theme). Why
not apply your design changes directly to the site definition? You have
already done a big part of the work by using a custom site definition, might
as well use its full potential.
--
Heather Solomon
http://www.heathersolomon.com/blog


"Miguel Ballesteros" wrote:

> Hi!, I'v been working in a coulple of site templates in WSS, defined as a new
> folder in the 1033 folder (the same location where STS and MPS are). The
> templates are working fine!
>
> Now, I need those site templates to use a specific Theme by default when a
> new site is created. I checked the HTML code in the default.aspx page before
> and after the Theme was applyed in a new site, but don't see any difference
> related with themes. Ok... the new site has a new folder named _theme, but
> there's no visible difference in the pages code.
>
> Does anyone know how to configure a site template to use a specific Theme as
> default for new sites in WSS?
>
> Thanks for any help
>
> --
> Miguel.
>

Kalmberg

2005-10-27, 7:03 pm

You cannot apply a theme using CAML.

However, you could use the "<ExecuteUrl Url=<some aspx page> />" in the
configuration section of your site definition and in that page write some
code that will apply an alternate theme, eg.

<script runat="server" language="vb">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
dim myNewWeb As SPWeb = SPControl.GetContextWeb(Context)
myNewWeb.AllowUnsafeUpdates = True
myNewWeb.ApplyTheme("mytheme")
myNewWeb.Update()

Response.Redirect(myNewWeb.Url)

End Sub
</script>

"Miguel Ballesteros" wrote:

> Hi!, I'v been working in a coulple of site templates in WSS, defined as a new
> folder in the 1033 folder (the same location where STS and MPS are). The
> templates are working fine!
>
> Now, I need those site templates to use a specific Theme by default when a
> new site is created. I checked the HTML code in the default.aspx page before
> and after the Theme was applyed in a new site, but don't see any difference
> related with themes. Ok... the new site has a new folder named _theme, but
> there's no visible difference in the pages code.
>
> Does anyone know how to configure a site template to use a specific Theme as
> default for new sites in WSS?
>
> Thanks for any help
>
> --
> Miguel.
>

IshaiSagi

2006-03-09, 9:00 pm

Good one!

Please see my blog for a step by step walkthrough on how to do just that:
www.spstips.blogspot.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com