1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Generic Content Based Modules and File Uploads

Generic Content Based Modules and File Uploads

5 posts, 0 answered
  1. dedi
    dedi avatar
    5 posts
    Registered:
    22 Oct 2008
    22 Oct 2008
    Link to this post
    Can one of the added metafields for a Generic Content Based Module be used for file uploads?
  2. dedi
    dedi avatar
    5 posts
    Registered:
    22 Oct 2008
    22 Oct 2008
    Link to this post
    Also, more specifically, what code is necessary if one were to want to use the builtin Rad or Sitefinity controls?

    How does Blogs do things like the Page selector, which is a special function on top of a basic meta field (i.e. Popup window, etc.)?
  3. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    23 Oct 2008
    Link to this post
    Hello dedi,

    Definitely, you could use a meta field to store the path to the uploaded files. For example Thumbnail in the News module serves as a field for saving the image urls. You could find more details how to add custom meta fields in the following topic of the Developer Manual: Add Custom Meta Fields.

    Regarding your second post, it is not quite clear what exactly you want to achieve. Could you please describe in details? Do you mean that you want to use RadControls for setting/getting the meta field value in the module administration?

    Greetings,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. dedi
    dedi avatar
    5 posts
    Registered:
    22 Oct 2008
    23 Oct 2008
    Link to this post
    Yes, I was wondering what the best way is to use RadControls to get/set the value for one of these metafields.  I am a bit confused as to what code is needed and where.
  5. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    24 Oct 2008
    Link to this post
    Hi dedi,

    The solution is to create a user control that wraps the RadControl and implements ITextControl interface. Here is an example with the RadEditor:
    1. Create a user control.
    2. D
    eclare RadEditor control on the user control.
    3. Implement ITextControl interface on the user control.
    4. Implement mandated Text property on the user control. In the get accessor return RadEditor.Content, in the set accessor set RadEditor.Content to the value.
    5. R
    egister your user control in the following templates:
        ~/Sitefinity/Admin/ControlTemplates/[Module_Name]/ControlPanelEdit.ascx
       
    ~/Sitefinity/Admin/ControlTemplates/
    [Module_Name]/ControlPanelInsert.ascx
    6.
    Declare the control inside the ItemTemplate of the ContentMetaFields control.
    7.
    Set the ID of the user control to the meta key for which you wish to use it

    For your convenience I have attached a user control that provides the described functionality.

    I hope you'll find this helpful.

    All the best,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
5 posts, 0 answered