associating additional information with image

Posted by Community Admin on 03-Aug-2018 16:20

associating additional information with image

All Replies

Posted by Community Admin on 29-Dec-2010 00:00

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

Posted by Community Admin on 30-Dec-2010 00:00

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

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 04-Jan-2011 00:00

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

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

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

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 07-Jan-2011 00:00

Hi,

I have figured this out. it was related to opacity issue in firefox.

Thanks,
Mohit

This thread is closed