Dynamic field for different provider

Posted by Community Admin on 03-Aug-2018 12:56

Dynamic field for different provider

All Replies

Posted by Community Admin on 17-Jan-2011 00:00

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

Posted by Community Admin on 17-Jan-2011 00:00

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

Posted by Community Admin on 17-Jan-2011 00:00

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

Posted by Community Admin on 17-Jan-2011 00:00

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

Posted by Community Admin on 17-Jan-2011 00:00

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

Posted by Community Admin on 20-Jan-2011 00:00

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

This thread is closed