Pages imported from 3.7 to 4.2 are retaining induvidual page

Posted by Community Admin on 04-Aug-2018 22:14

Pages imported from 3.7 to 4.2 are retaining induvidual page themes

All Replies

Posted by Community Admin on 01-Sep-2011 00:00

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

Posted by Community Admin on 07-Sep-2011 00:00

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 >>

This thread is closed