Feature request - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Feature request

  • Feature request
  • You know the cool new Css\Js widgets?...

    Would you perhaps be able to add in the ability to make those Themeable?  So a CSS rule for example would only render for X theme?
  • Hello Steve,

    Thank you for the feature request. We will log it for review by the team. However I am not quite sure that this will be implemented because if you wish to have a style rule render only for a particular theme you can just input it in the theme's rules.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  • Thanks, it's a local need for us...custom style (inline or external) only loaded for a single page of a certain theme.

    So I guess I can try to override it and add it in myself...
  • Hi Steve,

    You can try with an override of the default CssEmbedControl. You will get the current page's theme and if it is not the desired one you will not create the control:
    using System.Web;
    using System.Linq;
    using Telerik.Sitefinity.Web;
    using Telerik.Sitefinity.Web.UI.PublicControls;
    using Telerik.Sitefinity;
     
    namespace Sitefinity.Samples
        class CustomCssEmbedControl : CssEmbedControl
        
            protected override void CreateChildControls()
            
                SiteMapNode currentNode = SiteMapBase.GetCurrentProvider().CurrentNode;
                PageSiteNode node = (PageSiteNode)currentNode;
                var pageNode = App.WorkWith().Pages().Where(p => p.UrlName == node.UrlName).Get().FirstOrDefault();
                if (pageNode.Page.Theme == "ThemeName")
                
                    base.CreateChildControls();
                
            
        

    The above sample code should get you on the track to achieving this.

    Greetings,
    Radoslav Georgiev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.