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

Forums / General Discussions / Dynamic field for different provider

Dynamic field for different provider

6 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    17 Jan 2011
    Link to this post
    Hi all,

    I've some questions about images:

    1. How can I add a new provider for an image library to which I can add dynamic fields?
    2. How can I find images based on a dynamic field? I've found some forum posts with GetValue and SetValue but this doesn't work anymore in the official release?

    Regards,
    Daniel
  2. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    17 Jan 2011
    Link to this post
    Hi Daniel,

    1. Unfortunately, the current implementation of custom fields doesn't support custom providers. All other functionality in images would work with a custom provider, though. If separation of images by some condition is the only reason for creating a provider, think of some other way of distinguishing between them (tags, categories, your own taxonomy).

    2. You can filter items by the value of a dynamic field through dynamic LINQ. Here's an example (I have created a custom field with name TestField and type ShortText):

    var images = App.WorkWith().Images().Get().Where(@"TestField == ""somevalue"" && ContentState == ""PUBLISHED""");
    foreach (var img in images)
    {
        Response.Write(img.Title + "\n");
    }


    Note that you have to include the Telerik.Sitefinity.Data.Linq.Dynamic namespace.

    Greetings,
    Slavo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    17 Jan 2011
    Link to this post
    Okay, thanks for the explanation.

    Well, I do want an album that contains some images that would have some dynamic fields that are required. Of course they shouldn't be required with other albums, so that is the issue I have now. In SF 3.7 this was possible.

    Regards,
    Daniel
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    17 Jan 2011
    Link to this post
    Hi Daniel,

    This scenario is not supported in 4.0. We will consider it for future implementations.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    17 Jan 2011
    Link to this post
    So any other way I can achieve this? I rely quite a bit on this in different modules. I'm trying to migrate a few SF 3.7 sites to 4.0, but I'm stuck on this issue...

    Any reason why this is not implemented in 4.0?

    Regards,
    Daniel
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    20 Jan 2011
    Link to this post
    Hello Daniel,

    The reason it is not implemented in 4.0 is that we are actually using a features which comes from OpenAccess, and we provide API for it. The dynamic fields are implemented in OpenAccess and are per type, rather on provider. 
    The only way to hide fields for some albums is to do in the UI level. There should be some kind of filtering there, what to be shown and what to be hidden. We may try to provide some help there as well.

    Regards,
    Georgi
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
6 posts, 0 answered