Online sandbox has images on their custom layout controls??

Posted by Community Admin on 03-Aug-2018 22:29

Online sandbox has images on their custom layout controls??

All Replies

Posted by Community Admin on 18-Jan-2011 00:00

Why am I unable to do that yet....or can I, and it's hidden somewhere.

Posted by Community Admin on 19-Jan-2011 00:00

Hello Steve,

I am attaching a step-by-step tutorial how to add custom layout widgets in your project.

Kind regards,
Jordan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 19-Jan-2011 00:00

Thank you so much for that Jordan :)

Ok, SOOO...if my layout is created in my control assembly, and at the top I link in a ResourceLink to a CSS file which defines those images as embedded resources IN my assembly...same deal, that'll work?

Posted by Community Admin on 19-Jan-2011 00:00

Hello Steve,

This will work for sure, it is pure CSS. The only problem will be if the CSS linked in your control is loaded before the Sitefinity's embeded styles. In such case just use !important.


Kind regards,
Jordan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 19-Jan-2011 00:00

Oh good, I was worried about iframe issues or something else

I'll get on it, thanks!

Posted by Community Admin on 20-Jan-2011 00:00

One more quick ! if you dont mind...

Is there some way to set that CssClass in the custom LayoutControl class?  I dont see an obvious property available (I'd just like the users to not have to enter it)

Posted by Community Admin on 20-Jan-2011 00:00

Hi Steve,

You can set a CSS class for the wrapper element when you register the widget.




All the best,
Jordan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 20-Jan-2011 00:00

Hey Jordan,
  Yeah I know, I saw that in the image, the question though was can I set it in the code so the user doesn't have to do that....like I set the Layout Template Name in the SimpleView code....

Posted by Community Admin on 20-Jan-2011 00:00

Hello Steve,

ResourceClassId is a configuration property. Generally you can access it from your custom control or using a custom configuration.

Best wishes,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 21-Jan-2011 00:00

So something like this in the layout?

[ConfigurationProperty("ResourceClassId", "CssClass=Test")]

Im not familar with config properties, says it needs to decorate a property but I dont see a CssClass property in LayoutControl

Posted by Community Admin on 21-Jan-2011 00:00

Hi Steve,

You have to work with the system configurations


            var t = Config.Get<ToolboxesConfig>().Toolboxes;
            var res = t.Values.First().Tools.First().Value.ResourceClassId;

Best wishes,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 24-Jan-2011 00:00

Hey Ivan,
Ok, so this is what I ended up doing...

public void AssignToolboxIcon(string cssClass)
            if (this.IsDesignMode() == true)
                try
                    string type = this.GetType().ToString();
                    var toolboxes = Telerik.Sitefinity.Configuration.Config.Get<ToolboxesConfig>().Toolboxes;
                    var layouts = toolboxes.Values.FirstOrDefault(x => x.Name == "PageLayouts");
                    foreach (var config in layouts.Tools)
                        ToolboxItem tool = config.Value;
                        if (tool.ControlType == type)
                            if (String.IsNullOrEmpty(tool.CssClass))
                                tool.CssClass = cssClass;
                            
                            break;
                        
                    
                
                catch (Exception ex)
                
            
        

Does that look about right?....seems to work, but nothing persists

Posted by Community Admin on 24-Jan-2011 00:00

**Edit**

Something just occurred to me...

Where do I put the styling for this in my assembly such that when it's installed they all showup in the backend...

I was attaching my custom designer css in the ResourceLink control but as I was playing around I realized that style wont be coming down unless there's a control on it...

This thread is closed