1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Pages imported from 3.7 to 4.2 are retaining induvidual page themes

Pages imported from 3.7 to 4.2 are retaining induvidual page themes

2 posts, 0 answered
  1. Chip Gallent
    Chip Gallent avatar
    41 posts
    Registered:
    06 Nov 2009
    01 Sep 2011
    Link to this post
    We have imported/converted a site in 3.7 into a 4.2 site and the individual pages are retaining their themes if the theme was set at the page level in 3.7.

    Couple of things:
    1. We have removed the second theme from the site and that didn't fix it.
    2. The correct theme is set on the template that is applied to the page - but it's still not fixing the issue.
    3. When you load the page an alert is popping up at the top that says the deleted theme can't be found. This happens even when the theme is set for the template.

    Any ideas how to clear the theme at the page level? I don't want to have to rebuild the pages.

    Thanks,
    CG
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    18 Aug 2017
    07 Sep 2011
    Link to this post
    Hello Chip,

    I suppose the migration has preserved the names of the themes in the database you can check in table sf_page_templates. To change the currently selected themes please run this API code in the Page_Load method of a webform.
    var tManager = PageManager.GetManager();
                var templates = tManager.GetTemplates().Where(t => t.Title == "Template Name");
    // put the name of the template
                foreach (var t in templates)
                {
                    var draft = tManager.EditTemplate(t.Id);
                    draft.Themes.SetString(CultureInfo.CurrentUICulture, "Basic");
    //name of the theme that should be used
                    tManager.PublishTemplateDraft(draft.Id);
                    tManager.SaveChanges();
                }


    All the best,
    Stanislav Velikov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

2 posts, 0 answered