Assigning CSS stylesheets to sites

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following sample code shows how you can assign a an existing CSS stylesheet to a site:




using CMS.SiteProvider;




       // Get stylesheet and site object

      CssStylesheetInfo csi = CssStylesheetInfoProvider.GetCssStylesheetInfo("TestStylesheet");

      SiteInfo si = SiteInfoProvider.GetSiteInfo("CorporateSiteASPX");


      // If both exist

      if ((csi != null) && (si != null))


          // Add stylesheet to site

          CssStylesheetSiteInfoProvider.AddCssStylesheetToSite(csi.StylesheetID, si.SiteID);




Page url: