More in this section

Forums / Developing with Sitefinity / Reusing Sitefinity content items in custom controls

Reusing Sitefinity content items in custom controls

2 posts, 0 answered
  1. Roberto
    Roberto avatar
    146 posts
    08 Feb 2008
    24 Jun 2011
    Link to this post

    I am currently developing a custom control that will have property information (the commercial starter kit would have been a great base for this but i am unsure where that is?)  the base of the information is just your basic peoprties name, details etc but there are some other additional items that are required such as images and video.  Now i do not want to reinvent the wheel, what i would like to do is use the objects that are already built into the system as opposed to build things into my model that are not really required.

    So i guess my questions are:

    1 - Can i include content types such as Documents directly in my model, and how will that effect the persistence (i am going to try and implement a OpenAccess model...eeek)
    2 - How can i reuse the UI in the admin, so for instance, i have a button or something that allows the user to upload images that go into a specific library (if one doesnt exist it creates one)  this is not set in stone i am just trying to get the user experience out of my head and onto the page.

    Any advice would be great!


  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    29 Jun 2011
    Link to this post
    Hello Roberto Modica,

    There are two approaches that you can take here.

    The first one is to store only the ID of the item that you want to link to. This will allow you to reuse the MediaContentSelector to link to documents. I have a ready sample which uses this selector for images. What you have to do is to change the InitializeControls method of the dialog to set the media content selector view to use documents type. The control is created following the steps from this blog post. I have also attached a modified template for the news view control which pulls the value of the image and then displays it.

    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered