Your request has been answered at the support ticket. The solution provided is for modules that inherit from ContentModuleBase. If your module is inheriting from module base the solution is different.
For the benefit of the community here is the solution we provided:
We don`t have a definition for document selector. Your request can be achieved by creating a custom field for the module and using document selector dialog in this field to upload documents in a library and select documents from existing libraries.
I have attached a project with EditorContentManagerDialog. You can use it for the custom field.
The current mode is to select images
DialogMode="Image" //change it to Document or the other available options
The sample works by displaying a button in the module backend that will open RadWindow(SelectorUserControl.ascx). In the window the document selector will be loaded(ImageSelectorDialog.ascx). It is taking the functionality from(ImageSelectorDialog.cs).
In the scenario where you have module with definitions the approach to add the field is:
1.Create a custom field for the module(short text).
2.(refer to this
post for more information oh how to create a customized custom field with your own template)
3. The field will have to display the rad window(SelectorUserControl.ascx) so it will have to be created similar to the sample in the post. The .ascx file will be embedded resource and you will have to create a code file that will call the embedded template with rad window. The code file have to add virtual path to the template
protected override string LayoutTemplateName
return ChoiceFieldCustom.layoutTempalte; // this is the name of the class
private const string layoutTempalte = "~/Samples/SitefinityWebApp.Choice.AlbumSelectorField.ascx"; // this is the full path to the file which is under folder Choice and the virtuial path is called ~/Samples/
After creating this go to settings for the module (I will give example with products module) Products->Controls->ProductsBackend->Views->(select view)->Sections->CustomFieldSection and find the field you created and in field type you should be having Telerik.Sitefinity.Web.UI.Fields.TextField change it to YourProjectName.PathToTheCodeFileOfRadWindowControl.
You have to register the virtual path you assigned in the code file. Go to Administration->Settings->Advanced->VirtualPathSettings->VirtualPaths and create new virtual path
ResourceLocation: Name of your assembly
(A virtual path have to be created for the dialog code file as it references embedded .ascx file with the dialog too. This is done if the VP names are different).
4. Modify the .js file to use the namespaces of your project and remember to register the .js file in AssemblyInfo.cs
5. Check all namespaces of all code files. register the virtual paths and restart the application(make a dummy change in web.config) to apply the changes.
6. Copy the Global.asax file from the project I sent. It is used to call the dialog.
Excuse me for the long description. This is the method to add the dialog in a module since it is only available trough opening in a dialog.
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward!
We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>