Can a widget contain a layout?

Posted by Community Admin on 04-Aug-2018 14:57

Can a widget contain a layout?

All Replies

Posted by Community Admin on 12-Jun-2012 00:00

Can I drag\drop a widget and have a section of it already contain layouts to drop in other controls??

If not, why not, and when can I get my hands on this? :)

Posted by Community Admin on 14-Jun-2012 00:00

+1

Posted by Community Admin on 14-Jun-2012 00:00

@Kurt FYI, I opened a ticket on this...doesn't look like it's possible

FYI though it SHOULD be possible, can you imagine the possibilities?

Posted by Community Admin on 15-Jun-2012 00:00

@Steve: I think it would be really nice when we have a mechanism like 'layers', as they use in Orchard. That gives much more flexibility.

Maybe a nice addition for 5.2 ;)

Posted by Community Admin on 14-Apr-2013 00:00

Hello guys,

 I just wanted to share the information from the ticket (hopefully Steve won't mind). Here's the answer from one of our developers:

I understand that you actually need a widget which can be a container for other widgets in which you can implement your permissions logic. Unfortunately we do not have widgets like this which you can inherit from. 

So you can do two things. Inherit the widget that you need to have permissions (widgets that you want to be placed in permissions container). You can create a base control which implements the permissions and replace all tool box controls with new ones that will inherit from the corresponding Sitefinity widget and your new permissions control. 

Your other option is to plug into the front end page rendering and apply the permissions. To do so you need to register your own page resolver inherited from SitefinityPageResolver and to override the BuildControls method.

Here is an example:

public class CustomPageResolver : SitefinityPageResolver
    
        protected override void BuildControls(PageData pageData, List<IControlsContainer> controlConatiners, CursorCollection placeHolders, DirectiveCollection directives)
        
            base.BuildControls(pageData, controlConatiners, placeHolders, directives);
 
            //Iterate through the placeholders and modify their output here
        
    
The new page resolver should be registered in the Object Factory. This should be done after the Sitefinity Bootstrapper initialization. On application start, you need to subscribe for the "Initilized" event using the following code:
protected void Application_Start(object sender, EventArgs e)
       
           Bootstrapper.Initialized += OnInitialized;
             
       
  
       private static void OnInitialized(object sender, ExecutedEventArgs args)
       
           if (!ObjectFactory.Container.IsRegistered<CustomPageResolver>("CustomPageResolver"))
           
               ObjectFactory.Container.RegisterType<IVirtualFileResolver, CustomPageResolver>("CustomPageResolver",
                  new ContainerControlledLifetimeManager(), new InjectionConstructor());
           
       
In Advanced settings define the resolver to be used in your application: Advanced Settings > VirtualPathSettings > Virtual Paths > Create New VirtualPath = "~/SFPageService/*", ResourceLocation = "", ResolverName ="CustomPageResolver" .

Regards,
Jen Peleva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

The new page resolver should be registered in the Object Factory. This should be done after the Sitefinity Bootstrapper initialization. On application start, you need to subscribe for the "Initilized" event using the following code:
The new page resolver should be registered in the Object Factory. This should be done after the Sitefinity Bootstrapper initialization. On application start, you need to subscribe for the "Initilized" event using the following code:
The new page resolver should be registered in the Object Factory. This should be done after the Sitefinity Bootstrapper initialization. On application start, you need to subscribe for the "Initilized" event using the following code:

This thread is closed