How to: Create a user customizable widget for Sitefinity

If you’ve tried to create a widget (custom control) in Sitefinity (quick how to here ) you will have noticed that as easy as it is, it does not provide for customizations/administration from the backend.

However, adding fields for the admin to use for customization of your widget is as easy as providing the control with a public property. It’s that easy!

In my case for example, I needed the administrator to be able to list a number of libraries to be ignored by the current control (the control was a custom search engine).

In order to provide the administrator with a field to input library titles, I only had to add the following to my code:

public string userDefinedLibrariesNotToBeSearched
{
get
{
return _UserDefinedLibrariesNotToBeSearched;
}
set
{
_UserDefinedLibrariesNotToBeSearched = value;
}
}

Sitefinity CMS is clever enough to surface all your properties to the “edit properties” dialog box of your widget.

MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.