Feature request

Posted by Community Admin on 05-Aug-2018 17:13

Feature request

All Replies

Posted by Community Admin on 08-Nov-2010 00:00

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?

Posted by Community Admin on 08-Nov-2010 00:00

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.

Posted by Community Admin on 08-Nov-2010 00:00

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

Posted by Community Admin on 09-Nov-2010 00:00

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.

This thread is closed