Register data as default when install a custom module

Posted by Community Admin on 03-Aug-2018 18:55

Register data as default when install a custom module

All Replies

Posted by Community Admin on 21-Apr-2016 00:00

Hello, I need help, how i can add default data when a custom module is installed per first time, for example when the locations module is being installed i want also that register some locations.

Posted by Community Admin on 28-Apr-2016 00:00

Hello Edwin,

What type of custom module are you installing? Is it a custom static module or dynamic module (via Module builder)?

For static module you can use the Install method of the module's class. You can check the following sample of the ProductsModule in git hub:

https://github.com/Sitefinity-SDK/Telerik.Sitefinity.Samples.Products/blob/master/Products/ProductsModule.cs

For dynamic module you can use the EventHub and subscribe to the ... event:

http://docs.sitefinity.com/event-system-eventhub

protected void Application_Start(object sender, EventArgs e)
                   
            Bootstrapper.Initialized += Bootstrapper_Initialized;
        
 
        void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
        
            if (e.CommandName != "Bootstrapped")
                     
                EventHub.Subscribe<IDynamicModuleTypeCreatedEvent>(evt => DynamicModuleTypeCreatedEvent(evt));
            
        
 
        private void DynamicModuleTypeCreatedEvent(IDynamicModuleTypeCreatedEvent evt)
        
            //logic...
        


Regards,
Pavel Benov
Telerik
 
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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 02-May-2016 00:00

Hello Pavel thanks for answer my question but i already do this also as you say in the install method of my custom static module.

Now i have another problem, why can not delete the actions column for example if i don't add my custom data column "pathColumn" it not will be see in the items list, but with ActionsMenuColumn seems like it doesn't work.

(Please see capture.png and ignore upload.png)

Posted by Community Admin on 12-May-2016 00:00

Hi Edwin,

Can you comment out the entire logic for the Actions menu column, rebuild the solution and try again? Additionally please test this by first clearing your browser's cache (or inspecting this on another browser).

Regards,
Pavel Benov
Telerik

 
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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed