Sitefinity apis, get images by category
Hello,
I was wondering if it is applicable to categorize Image Albums ? Of not can I assign a cutsom meta field to an Album ?
An also, how can I select images by category using the sitefinity apis ?
Thanks,
Hello Mohamed,
Currently the only way of adding a custom field to an Album is through code - you should use the TryCreateNew() method of the DynamicData facade - for instance:
App.WorkWith().DynamicData().Type(
typeof
(PageData)).Field().TryCreateNew(
"MyPageDataField"
,
typeof
(
string
)).SaveChanges(
true
);
var myImages= App.WorkWith().Images()
.Where(t => t.Status ==Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live)
.Get()
.ToList();
foreach
(var item
in
myImages)
var summary = item.GetValue(
"Summary"
);