Is there a way to programmatically set themes for applications?

In v12 both the blog and article applications support application level themes, we can programmatically create these applications but I cannot see a way to set the theme programmatically

The only option seems to involve changing the default theme for these application types in the admin panel

Is there a way to set these programmatically, we have a job which creates groups and the concern is that the default application type theme is not as expected, if an admin changes it for example  

Parents
  • Former Member
    +1 Former Member

    Similar question here:  Apply Theme to all blogs 

    You could change the default theme in Administration > Applications > Blogs > Default Presentation under "Default Theme." If you previously only had one theme, that should effectively change all blogs.

    To programmatically set the theme, load the IConfigurableThemeableApplicationType from PluginManager where the ApplicationTypeId is equal to the blog application's ApplicationTypeId. You can then loop on blogs in the community programmatically and use the SetTheme() method to forcefully set the theme for each blog.

    I'd also recommend looking at the UI Automation developer training for details on what capabilities are available to programmatically adjust UI components and page definitions.

Reply
  • Former Member
    +1 Former Member

    Similar question here:  Apply Theme to all blogs 

    You could change the default theme in Administration > Applications > Blogs > Default Presentation under "Default Theme." If you previously only had one theme, that should effectively change all blogs.

    To programmatically set the theme, load the IConfigurableThemeableApplicationType from PluginManager where the ApplicationTypeId is equal to the blog application's ApplicationTypeId. You can then loop on blogs in the community programmatically and use the SetTheme() method to forcefully set the theme for each blog.

    I'd also recommend looking at the UI Automation developer training for details on what capabilities are available to programmatically adjust UI components and page definitions.

Children