2

I am trying to get all of the available themes for a site collection. When I call GetManagedThemes() I get 0 results. I have tried several site collections and they all return 0 themes.

internal static List<ThmxTheme> GetAvailableThemes(string siteUrl)
    {
        List<ThmxTheme> themes = new List<ThmxTheme>();
        using (SPSite projectSite = new SPSite(siteUrl))
        {
            using (SPWeb web = projectSite.OpenWeb())
            {
                ReadOnlyCollection<ThmxTheme> thmxThemes = ThmxTheme.GetManagedThemes(projectSite);
                foreach (ThmxTheme theme in thmxThemes)
                {
                    themes.Add(theme);
                }
            }
        }
        return themes;
    }

The code above is shown in many examples on the net.

The site collections have the OOB themes available. (I can change the theme using the "Change the Look" option in settings.)

AdamBT
  • 356
  • 2
  • 17
  • 1
    I confirmed the behavior : The collection of Themes is always empty. Note: Was tested on a pre SP1 VM (not sure if was corrected in SP1). –  Jul 04 '14 at 21:47

0 Answers0