Dynamic module and custom control
I have created a custom control in visual basic to display data from a dynamic module structure called Lectures. My question is that I would like to be able to add the dynamic module to a page for a single lecture entity and add my custom control to the same page. The custom control should then determine the single lecture entity as a property from the dynamic module and determine which lecture entity was selected when adding the dynamic module to the page..
I am really inexperienced with Sitefinity and could really use some detailed instructions.
Thank you
Perhaps I should phrase this differently.
I have a custom control that retrieves data from a dynamic module structure I have created call Lectures.
When I add my custom control to a page in sitefinity and choose edit I would like the properties list that is displayed to allow me to select one of the lectures I created in the dynamic modules.
How can this be accomplished?
Thanks,
Bill
Hi Bill,
If I understand correct you want to have multi view control designers. I would suggest you to review this article from our documentation:
http://www.sitefinity.com/documentation/documentationarticles/multi-view-control-designers
The other option that you have is to create a selector using Thunder in the designer and then implement some custom code that will get the items that are selected in the selector and will display them in the list view:
http://www.sitefinity.com/documentation/documentationarticles/creating-widget-designers
Furthermore, when you open your project in Visual Studio you will see a Thunder starting page, go to Create Sitefinity items and select Dynamic items field selector. You could watch the video available there and find some additional information below.
Regards,
Stefani Tacheva
Telerik
Good morning, sorry it took so long to get back to you.
I used the Designer for existing widget from the Thunder page and it did create a Widget Designer. Sadly I can not get it to work.
When I click Edit in Sitefinity fot he widget I get the following:
Server Error in '/Dev_GF' Application.Cannot find template "~/SotirISQuizModule/SotirISQuizModule.SotirISQuizModuleDesigner.ascx". Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Cannot find template "~/SotirISQuizModule/SotirISQuizModule.SotirISQuizModuleDesigner.ascx".
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Cannot find template "~/SotirISQuizModule/SotirISQuizModule.SotirISQuizModuleDesigner.ascx".] Telerik.Sitefinity.Web.UI.ControlUtilities.GetTemplate(String virtualPath, String resourceFileName, Type assemblyInfo, String templateDeclaration, Boolean addChildrenAsDirectDescendants) +548 Telerik.Sitefinity.Web.UI.ControlUtilities.GetControlTemplate(TemplateInfo info) +992 Telerik.Sitefinity.Web.UI.SimpleView.get_LayoutTemplate() +184 Telerik.Sitefinity.Web.UI.SimpleView.get_Container() +40 Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +62 System.Web.UI.Control.EnsureChildControls() +182 System.Web.UI.Control.PreRenderRecursiveInternal() +73 System.Web.UI.Control.PreRenderRecursiveInternal() +240 System.Web.UI.Control.PreRenderRecursiveInternal() +240 System.Web.UI.Control.PreRenderRecursiveInternal() +240 System.Web.UI.Control.PreRenderRecursiveInternal() +240 System.Web.UI.Control.PreRenderRecursiveInternal() +240 System.Web.UI.Control.PreRenderRecursiveInternal() +240 System.Web.UI.Control.PreRenderRecursiveInternal() +240 System.Web.UI.Control.PreRenderRecursiveInternal() +240 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3914 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1008
The path for the .ascx page and the .JS file as generated by the wizard are:
Public Shared ReadOnly m_layoutTemplatePath As String = "~/SotirISQuizModule/SotirISQuizModule.SotirISQuizModuleDesigner.ascx" Public Const scriptReference As String = "SotirISQuizModule.SotirISQuizModuleDesigner.js"I have tried modifying the path to the .ascx to no avail.
Any suggestions?
Sorry, I probably should have included some idea as to my file structure.
See the attached image.
SitefinityWebApp is the project for my sitefinity project.
SotirISQuizModule is the project for my custom control.
GOT IT!!
Changed the code for the widget designer to use LayoutTemplateName instead of LayoutTemplatePath.
Thanks for all of the help!