Custom widgets recommendations

Posted by Community Admin on 04-Aug-2018 10:59

Custom widgets recommendations

All Replies

Posted by Community Admin on 07-Sep-2011 00:00

Hi,

With custom Widgets, do you have any recommendations or best practices concerning on how we could manage them in our Visual Studio solution.

How should we organize them,
- to be easily reusable ?
- not to bother too much about copying manually .ascx around ?

What do other developers suggest ?

EDIT: To be a bit more clear, we would like to move our common widgets to a dedicated solution, but we're not sure how to handle ascx files in this case. What are the best practices to create reusable ascx files? Or should we stop using ascx files?

Thanks,

Olivier

Posted by Community Admin on 07-Sep-2011 00:00

Simple widgets are designed mainly to exist in the Sitefinity project in which they are going to be used. If you want to reuse them in another site you'll have to copy all the controls and related files and resources (ascx, images, scripts, etc) into the new project and make sure all the paths are correct. This is the nature of working with asp.net User Controls in general.

However, Sitefinity also supports developing custom server controls. These are controls that exist in a separate project, and are compiled into their own dll. All of the resources (ascx, images, scripts, etc) are embedded into the DLL so all you need to do to reuse them in another Sitefinity site is to either reference the compiled DLL or add that project to the Sitefinity solution.

I'm working on a blog post that demonstrates how to create a custom compiled widget, but until then there are several examples of these types of widgets in the Sitefinity SDK. Take a look at the Non-profit starter kit, which includes three compiled widgets (Calendar, Maps, Social).

I hope this is helpful!

Posted by Community Admin on 24-May-2012 00:00

I was wondering if you were able to create a custom compiled widget into a Sitefinity project?

Posted by Community Admin on 24-May-2012 00:00

I was wondering if you were able to create a custom compiled widget into a Sitefinity project?

This thread is closed