associating additional information with image
Hi,
I am creating a custom Image gallery in sitefinity. in my image gallery i want to display some particular relevant information on top of every image. and when user clicks on that link I want to show up a map of that particular image location on top of that image. i need to associate some additional information with image like latitude, longitude and description.how can I store this additional information in sitefinity associated with individual image.
Thanks,
Mohit
Hi Mohit,
With Sitefinity RC2 we introduced custom fields for objects that inherits from Telerik.Sitefinity.GenericContent.Model.Content which will allow you to associate some custom data with your items. You can use the fluent API in your custom implementation to get the custom filed values
var imgs = App.WorkWith().Images().Where(img => img.GetValue("longt") == "somevalue");
The Content item has extension methods that you can use
GetValue - gets the value of a dynamic property.
DoesFieldExist - extension method that determines if the dynamic field exists on the type
SetValue - sets the value of a dynamic property of data item to a different value.
Kind regards,
Ivan Dimitrov
the Telerik team
Hi Ivan,
I am adding custom meta fields to my control and i can get those in my code.
but they are not getting displayed on page.
I am using this template to display image and a caption on it.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CustomImageGallery.ascx.cs"
Inherits="SitefinityWebApp.UserControls.CustomImageGallery" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<sf:RadRotator ID="ImageRotatorId" runat="server" RotatorType="AutomaticAdvance" Width="550" Height="260">
<ItemTemplate>
<asp:Image runat="server" ID="newsImage"></asp:Image>
<asp:HyperLink runat="server" ID="caption" style =" left:0px;top:0px; background-color:Red; font-size:xx-large;"></asp:HyperLink>
</ItemTemplate>
</sf:RadRotator>
but I am not able to see this caption on my control even tough it is there when I see page source. is there some other property that i need to set in my code?
Thanks,
Mohit
Hi Mohit,
Can you please show us the code of your custom control which binds the images to the Rotator?
Kind regards,
Radoslav Georgiev
the Telerik team
Hi,
I have figured this out. it was related to opacity issue in firefox.
Thanks,
Mohit