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

Forums / Developing with Sitefinity / MultiImageFieldElement?

MultiImageFieldElement?

4 posts, 0 answered
  1. Saad
    Saad avatar
    98 posts
    Registered:
    10 Oct 2008
    12 Oct 2011
    Link to this post
    Can anyone please let us know how can we use MultiImageFieldElement in our modules? Its one of the most needed functionality so please try to give some working example.
  2. Svetoslav Petsov
    Svetoslav Petsov avatar
    456 posts
    Registered:
    24 Sep 2012
    17 Oct 2011
    Link to this post
    Hello Saad,

     The MultiImageFieldElement is not meant for generic content based modules. It is used in the eCommerce module and has a number of prerequisites that have to be implemented in the data provider and the web service for managing your items.
    An easier approach is to create a text type field and store image IDs in it. You can use RadGridClientBinder for the backend interface and populate image IDs in a string field.
    You can try developing such a control using this blog post:
    http://www.sitefinity.com/blogs/slavoingilizov/posts/11-02-11/creating_a_thumbnail_selector_for_news_items.aspx
    If you need further assistance, you can get back to me.

    All the best,
    Svetoslav Petsov
    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
  3. Saad
    Saad avatar
    98 posts
    Registered:
    10 Oct 2008
    17 Oct 2011
    Link to this post
    Well, I have already seen the blog post you`ve sent. Its good but MultiImageFieldElement is better.
    I believe that custom module with such functionality (one or more images associated with each item) would also be easy to query for items and their images, basically a pure approach.

    I did implement the link you have sent. But still I would want to have what you guys have implemented in ecommerce products module. 

    A small example or brief on pre-requisites would be appreciated a lot. And I know lot of people would be looking for this.
  4. Svetoslav Petsov
    Svetoslav Petsov avatar
    456 posts
    Registered:
    24 Sep 2012
    21 Oct 2011
    Link to this post
    Hello Saad,

     I made a multi image selector field control for you. Here's the general idea:
    This is a field control that inherits from TextField. In the template of the field I have added a few controls, one of which is a Grid that uses a GridBinder to get images through our Content service and bind them to the Grid. In the textbox of the field, I am keeping an array of the GUIDs of all images that are added. What I change when deleting/adding a new image is just the FilterExpression of the GridBinder which is used to filter the images that are returned by the content service. It's a bit complicated, so if you have any questions, feel free to ask (or if you find any bugs).
    In order to install the control, add a reference to the assembly of the control, then add a VirtualPath, using the VirtualPathProvider so that the embedded templates/scripts can be loaded from the control's assembly.  The Virtual Path that should be registered is ~/Ctrls/* (check the screenshot to see how to add it):


    Next, go to CustomFields (for News for example) and add a field of type LongText, specify a title that you wish and add a CustomWidget for displaying data of type:
    Controls.ImageSelector:

    Hope the control suits your needs.

    Best wishes,
    Svetoslav Petsov
    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
4 posts, 0 answered