Developer forum

Forum » Development » CustomModule icons

CustomModule icons

Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi there,

Is it possible to add icons to a custom module in DW9? The documentation I found it's not working for me, and it seems to refer to DW8.
http://developer.dynamicweb-cms.com/documentation/for-developers/dynamicweb-custom-modules/building-modules-series/miscellaneous-tips.aspx

Thanks!
BR, Mario

 


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Hi Mario,

You can use one of the icons found in Settings > Developer > List of all known icons

There are two ways to add an icon to your module.

A) Execute SQL update script on the Module table

Example:

UPDATE [Module] SET [ModuleIconClass] = "Umbrella" WHERE [ModuleSystemName] = "MyCustomModule"

Replace the values to match your module.

B) Use module annotations

Example:

using Dynamicweb.Core.UI.Icons;
using Dynamicweb.Modules;
using Dynamicweb.Modules.Annotations;

namespace Dynamicweb.Examples
{
    [ModuleName("ModuleSystemName", "Module name")] // Required.
    [ModuleDescription("Some description of thís module")] // Optional.
    [ModuleIcon(KnownIcon.Tasks)] // Optional. The name of a known icon in Dynamicweb which will be displayed in the management UI. See documentation for details.
    [ModuleEditPanel("/CustomModules/ModuleSystemName/ModuleSystemName_Edit.ascx")] // Optional. Path to the module edit panel of this module (.ascx or .aspx).
    [ModuleControlPanel("/CustomModules/ModuleSystemName/ModuleSystemName_ControlPanel.aspx")] // Optional. Path to the control panel of this module (.aspx).
    [ModuleScriptPanel("/CustomModules/ModuleSystemName/ModuleSystemName_Admin.aspx")] // Optional. Full path to the management panel of this module (.aspx).
    [ModuleAccess(true)] // Optional. Setting this to false will disable this module by default. Default value is true.
    public class ContentModuleWithAnnotationsSample : ContentModule
    {
        public override string GetContent()
        {
            return "Hello world";
        }
    }
}

Best regards,
Morten

Votes for this answer: 1
 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Thanks for your reply, Morten.

BR, Mario

 

 

You must be logged in to post in the forum