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

Forums / General Discussions / associating additional information with image

associating additional information with image

5 posts, 0 answered
  1. Mohit
    Mohit avatar
    19 posts
    Registered:
    04 Oct 2010
    29 Dec 2010
    Link to this post
    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
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 Dec 2010
    Link to this post
    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
  3. Mohit
    Mohit avatar
    19 posts
    Registered:
    04 Oct 2010
    04 Jan 2011
    Link to this post
    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
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Jan 2011
    Link to this post
    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
  5. Mohit
    Mohit avatar
    19 posts
    Registered:
    04 Oct 2010
    07 Jan 2011
    Link to this post
    Hi,

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

    Thanks,
    Mohit
5 posts, 0 answered