MVC widget icon (Not sidebar icon) - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

MVC widget icon (Not sidebar icon)

  • Hi,

    I am currently developing custom MVC widget. I would like to know how to add custom icon to the widget after it was dragged into a pocket?

    I used a content block as a comparison to my widget which doesn't has its icon.

    Please help. Thanks!

  • Hi,

    You need to change the MVCTemplateEditorRouteHandler  and MVCPageEditorRouteHandler, use this:

    www.crmportalconnector.com/.../adding-widget-icons-to-your-custom-sitefinity-mvc-widgets-with-code

    The MVCTemplateEditorRouteHandler is public in Sitefintiy 11.

  • How about the anchor link that can open the widget designer, will it be added after I change the route handler?

  • Hi,

    Another approach will be to implement the interface ICustomWidgetVisualizationExtended as we do in the Image widget, Content block widget, etc. Using this interface you will need to set the IsEmpty property and WidgetCssClass. Then the CSS class will be applied only when the IsEmpty condition is met and only while you are in edit of page.

    Regards,

    Elena