More in this section

Forums / General Discussions / Bulk Template Changes

Bulk Template Changes

2 posts, 0 answered
  1. Armysniper
    Armysniper avatar
    126 posts
    03 Mar 2005
    06 Aug 2009
    Link to this post
    My content authors created a bunch of pages but assigned them to a specific template. I would like to reassign all of the pages to use the "Template Theme" as we just changed our main Theme. Is there a way to bulk edit these with tools or UI or SQL?
  2. Georgi
    Georgi avatar
    3583 posts
    28 Oct 2016
    12 Aug 2009
    Link to this post

    You can use the following code to change the page theme:
    public partial class UserControls_ChangeThemes : System.Web.UI.UserControl 
        protected void Button1_Click(object sender, EventArgs e) 
            CmsManager manager = new CmsManager(); 
            IList pages = manager.GetPages(); 
            foreach (IPage page in pages) 
                ICmsPage p = manager.GetPage(page.ID, trueas ICmsPage; 
                p.Theme = "Blue with right sidebar"

    This way, all pages will have the "Blue with right sidebar" theme. 

    Please backup your database first, in case you want to revert back the changes. 

    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
2 posts, 0 answered